JDK-8205699 : assert(_owner_offset != 0) failed in javaClasses.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-06-26
  • Updated: 2019-03-28
  • Resolved: 2018-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11 b20Fixed 12Fixed
Related Reports
Relates :  
Relates :  
Description
assert(_owner_offset != 0) failed in javaClasses.cpp if the following tests are run in CDS mode.

applications/kitchensink/Kitchensink.java Tier4
applications/runthese/RunThese30M.java Tier3, Tier4
java/lang/management/ThreadMXBean/FindDeadlocks.java Tier3
java/lang/management/ThreadMXBean/LockedSynchronizers.java Tier3
java/lang/management/ThreadMXBean/MyOwnSynchronizer.java Tier3

open/src/hotspot/share/classfile/javaClasses.cpp:4424), pid=9653, tid=9662
#  assert(_owner_offset != 0) failed: Must be initialized
#

To reproduce the problem:
- generate a CDS archive by running: java -Xshare:dump
- run the test as usual using jtreg
Comments
Caused by JDK-8199882, which introduced early loading of AbstractOwnableSynchronizer class, but omitted the necessary "serialize" method to include this in the CDS dump.
27-06-2018

Corrected version of the serialize() function: (BUFFER_FIELDS_DO replaced with AOS_FILEDS_DO) #if INCLUDE_CDS void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize(SerializeClosure* f) { AOS_FIELDS_DO(FIELD_SERIALIZE_OFFSET); } #endif
26-06-2018

oddly, I was just looking at this code for your pre-review [~jiangli] It should be called in void MetaspaceShared::serialize_well_known_classes(SerializeClosure* soc) { too.
26-06-2018

Looks like it's missing the serialize() function so the field offset is not written into the archive. javaClasses.cpp #if INCLUDE_CDS void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize(SerializeClosure* f) { BUFFER_FIELDS_DO(FIELD_SERIALIZE_OFFSET); } #endif java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize() then can be called in MetaspaceShared::serialize_well_known_classes().
26-06-2018

Looks like AbstractOwnableSynchronizer might not be archived (?) Not CMS.
26-06-2018

[~ccheung] Are these all with CMS garbage collector or just the hs_err_file that you posted? Can you link to the test run?
26-06-2018

Call stack from a hs err log. --------------- T H R E A D --------------- Current thread (0x00007fdaa824a000): VMThread "VM Thread" [stack: 0x00007fda88cf6000,0x00007fda88df6000] [id=30525] Stack: [0x00007fda88cf6000,0x00007fda88df6000], sp=0x00007fda88df45d0, free space=1017k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x18a796f] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x25f V [libjvm.so+0x18a878f] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f V [libjvm.so+0xb2b010] report_vm_error(char const*, int, char const*, char const*, ...)+0x100 V [libjvm.so+0xf02e47] java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(oop)+0x67 V [libjvm.so+0x17fec24] ConcurrentLocksDump::build_map(GrowableArray<oop>*)+0x64 V [libjvm.so+0x17ff11a] ConcurrentLocksDump::dump_at_safepoint()+0xfa V [libjvm.so+0x18ec01c] VM_ThreadDump::doit()+0x7bc V [libjvm.so+0x18ec472] VM_Operation::evaluate()+0x132 V [libjvm.so+0x18e7aee] VMThread::evaluate_operation(VM_Operation*) [clone .constprop.51]+0x18e V [libjvm.so+0x18e83a7] VMThread::loop()+0x4d7 V [libjvm.so+0x18e89b3] VMThread::run()+0xd3 V [libjvm.so+0x14f3e60] thread_native_entry(Thread*)+0x100 VM_Operation (0x00007fda5bde6d70): ThreadDump, mode: safepoint, requested by thread 0x00007fdaa84e8000
26-06-2018