[8u] 8236178: Debug build failed after 8225141

Andrew John Hughes gnu.andrew at redhat.com
Wed Dec 25 02:47:20 UTC 2019



On 18/12/2019 18:49, Severin Gehwolf wrote:
> Hi,
> 
> On Wed, 2019-12-18 at 14:54 +0000, Sergey Nazarkin wrote:
>> Hi!
>>
>> I’ve created critical bug [1]  since debug build is broken after one of latest changeset [2].  Please consider to include it into u242
>>
>> diff -r 9ef81b9152f1 src/share/vm/oops/instanceKlass.cpp 
>> --- a/src/share/vm/oops/instanceKlass.cpp Fri Nov 13 18:14:41 2015 +0300 
>> +++ b/src/share/vm/oops/instanceKlass.cpp Wed Dec 18 14:25:28 2019 +0300 
>> @@ -3605,7 +3605,7 @@ 
>>    bool good_state = is_shared() ? (_init_state <= state) 
>>                                                 : (_init_state < state); 
>>    assert(good_state || state == allocated, "illegal state transition"); 
>> - set_initialization_state_and_notify_implassert(_init_thread == NULL, "should be cleared before state change"); 
>> + assert(_init_thread == NULL, "should be cleared before state change"); 
>>    _init_state = (u1)state; 
>>  } 
>>  #endif
> 
> This looks good to me. It's what the JDK 11u code[i] has as well. Not
> sure why the backport for 8u was different.
> 
> Thanks,
> Severin
> 
> [i] http://hg.openjdk.java.net/jdk-updates/jdk11u/file/ae96767b40ff/src/hotspot/share/oops/instanceKlass.cpp#l3684
> 
>>
>> Sergey Nazarkin
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8236178
>> [2] https://bugs.openjdk.java.net/browse/JDK-8236058
>>
> 

There is a set_initialization_state_and_notify_impl function in that file:

void
InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle
this_oop, ClassState state, TRAPS) {
  oop init_lock = this_oop->init_lock();
  if (init_lock != NULL) {
    ObjectLocker ol(init_lock, THREAD);
    this_oop->set_init_state(state);
    this_oop->fence_and_clear_init_lock();
    ol.notify_all(CHECK);
  } else {
    assert(init_lock != NULL, "The initialization state should never be
set twice");
    this_oop->set_init_state(state);
  }
}

so maybe the intention was to call that before the assert, and the two
somehow got munged together. It doesn't look like the right place for
such a call though. Maybe Zhengyu can enlighten us.

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222
https://keybase.io/gnu_andrew



More information about the jdk8u-dev mailing list