JDK-8275445 : RunThese30M.java failed "assert(ZAddress::is_marked(addr)) failed: Should be marked"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,windows
  • CPU: x86_64
  • Submitted: 2021-10-18
  • Updated: 2021-10-26
  • Resolved: 2021-10-19
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 18
18 b20Fixed
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK18 CI:

applications/runthese/RunThese30M.java

Here's snippets from the hs_err_pid file:

#  Internal Error (/opt/mach5/mesos/work_dir/slaves/ff806ead-2cac-495d-9cbc-62116f99bf14-S14140/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/613f517d-67d3-486d-87f2-01f4b9f74b7d/runs/d2691236-49f2-4fbe-8646-dc091f7193b9/workspace/open/src/hotspot/share/gc/z/zBarrier.cpp:41), pid=23069, tid=23079
#  assert(ZAddress::is_marked(addr)) failed: Should be marked
#
# JRE version: Java(TM) SE Runtime Environment (18.0+20) (fastdebug build 18-ea+20-1223)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+20-1223, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x19ee898]  unsigned long ZBarrier::mark<false, true, false, true>(unsigned long)+0x238

<snip>

---------------  T H R E A D  ---------------

Current thread (0x00007f7258096910):  ConcurrentGCThread "ZDriver" [stack: 0x00007f72405e3000,0x00007f72406e3000] [id=23079]

Stack: [0x00007f72405e3000,0x00007f72406e3000],  sp=0x00007f72406e12a0,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x19ee898]  unsigned long ZBarrier::mark<false, true, false, true>(unsigned long)+0x238
V  [libjvm.so+0x2e6c0b]  AccessInternal::PostRuntimeDispatch<ZBarrierSet::AccessBarrier<548932ul, ZBarrierSet>, (AccessInternal::BarrierType)2, 548932ul>::oop_access_barrier(void*)+0xbb
V  [libjvm.so+0xed0a4e]  send_event(FinalizerEntry const*, InstanceKlass const*, TimeInstant<CounterRepresentation, FastUnorderedElapsedCounterSource> const&, Thread*)+0x6e
V  [libjvm.so+0xed184e]  JfrFinalizerStatisticsEvent::send_unload_event(InstanceKlass const*)+0xfe
V  [libjvm.so+0xefa938]  JfrKlassUnloading::on_unload(Klass const*)+0x218
V  [libjvm.so+0xf6c319]  do_unloading_klass(Klass*)+0x29
V  [libjvm.so+0x978a46]  ClassLoaderData::classes_do(void (*)(Klass*))+0x36
V  [libjvm.so+0x983c91]  ClassLoaderDataGraph::classes_unloading_do(void (*)(Klass*))+0x51
V  [libjvm.so+0xf71248]  write_klasses()+0x4a8
V  [libjvm.so+0xf72daa]  JfrTypeSet::serialize(JfrCheckpointWriter*, JfrCheckpointWriter*, bool, bool)+0x12a
V  [libjvm.so+0xea7517]  JfrCheckpointManager::on_unloading_classes()+0x57
V  [libjvm.so+0x181e674]  SystemDictionary::do_unloading(GCTimer*)+0x1d4
V  [libjvm.so+0x1a8a336]  ZUnload::unlink()+0xa6
V  [libjvm.so+0x1a22cda]  ZHeap::process_non_strong_references()+0x3a
V  [libjvm.so+0x1a1bf0c]  ZDriver::concurrent_process_non_strong_references()+0x7c
V  [libjvm.so+0x1a1d694]  ZDriver::gc(ZDriverRequest const&)+0x12c4
V  [libjvm.so+0x1a1e36f]  ZDriver::run_service()+0x1ef
V  [libjvm.so+0xa3f2ab]  ConcurrentGCThread::run()+0x2b
V  [libjvm.so+0x188d3e0]  Thread::call_run()+0x100
V  [libjvm.so+0x156cd04]  thread_native_entry(Thread*)+0x104
Comments
Changeset: 98ab4b03 Author: Markus Grönlund <mgronlun@openjdk.org> Date: 2021-10-19 13:00:50 +0000 URL: https://git.openjdk.java.net/jdk/commit/98ab4b03b311dcd8374cbbb21a898298798750d6
19-10-2021

send_event calls this function: static const char* codesource(const InstanceKlass* ik, Thread* thread) { assert(ik != NULL, "invariant"); assert(thread != NULL, "invariant"); oop pd = java_lang_Class::protection_domain(ik->java_mirror()); if (pd == NULL) { return NULL; } oop codesource = get_codesource(pd, thread); return codesource != NULL ? get_locationNoFragString(codesource, thread) : NULL; } which tries to load oops through a klass that has been found to be dead. The oops in that class are not safe to load and follow. The asserts detects that someone is trying to load these dead objects.
19-10-2021

Both of these crashes have: V [libjvm.so+0xed184e] JfrFinalizerStatisticsEvent::send_unload_event(InstanceKlass const*)+0xfe in the stack and jdk-18+20-1223-tier3 includes this fix: JDK-8266936 Add a finalization JFR event [~mgronlun] - Can you take a look at this new failure?
19-10-2021

Here's the crashing stack for the windows-x64 sighting in jdk-18+20-1223-tier3: --------------- T H R E A D --------------- Current thread (0x000001d642fdcd40): ConcurrentGCThread "ZDriver" [stack: 0x0000000d04900000,0x0000000d04a00000] [id=38384] Stack: [0x0000000d04900000,0x0000000d04a00000] Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [jvm.dll+0xae02c1] os::platform_print_native_stack+0xf1 (os_windows_x86.cpp:235) V [jvm.dll+0xcfe19e] VMError::report+0x101e (vmError.cpp:828) V [jvm.dll+0xcffb9e] VMError::report_and_die+0x7fe (vmError.cpp:1656) V [jvm.dll+0xd00324] VMError::report_and_die+0x64 (vmError.cpp:1437) V [jvm.dll+0x4ce677] report_vm_error+0xb7 (debug.cpp:282) V [jvm.dll+0xd482c4] ZBarrier::should_mark_through<0>+0x44 (zBarrier.cpp:41) V [jvm.dll+0xd48e47] ZBarrier::load_barrier_on_oop_slow_path+0x67 (zBarrier.cpp:130) V [jvm.dll+0x1cd3e] AccessInternal::PostRuntimeDispatch<ZBarrierSet::AccessBarrier<548964,ZBarrierSet>,2,548964>::oop_access_barrier+0x3e (access.inline.hpp:86) V [jvm.dll+0x6e6036] codesource+0x96 (jfrFinalizerStatisticsEvent.cpp:73) V [jvm.dll+0x6e660a] send_event+0xca (jfrFinalizerStatisticsEvent.cpp:86) V [jvm.dll+0x6e67a4] JfrFinalizerStatisticsEvent::send_unload_event+0x54 (jfrFinalizerStatisticsEvent.cpp:106) V [jvm.dll+0x6f5955] JfrKlassUnloading::on_unload+0x105 (jfrKlassUnloading.cpp:129) V [jvm.dll+0x4514ec] ClassLoaderData::classes_do+0x2c (classLoaderData.cpp:342) V [jvm.dll+0x4549c8] ClassLoaderDataGraph::classes_unloading_do+0x98 (classLoaderDataGraph.cpp:421) V [jvm.dll+0x7298a0] JfrTypeSet::on_unloading_classes+0x170 (jfrTypeSet.cpp:1102) V [jvm.dll+0x6d66fa] JfrCheckpointManager::on_unloading_classes+0x3a (jfrCheckpointManager.cpp:433) V [jvm.dll+0xc3db68] SystemDictionary::do_unloading+0x88 (systemDictionary.cpp:1604) V [jvm.dll+0xd7cc7a] ZUnload::_unlink+0xba (zUnload.cpp:149) V [jvm.dll+0xd57208] ZHeap::process_non_strong_references+0x38 (zHeap.cpp:322) V [jvm.dll+0xd54e3d] ZDriver::gc+0x38d (zDriver.cpp:464) V [jvm.dll+0xd553c7] ZDriver::run_service+0x137 (zDriver.cpp:497) V [jvm.dll+0x4b6fa5] ConcurrentGCThread::run+0x35 (concurrentGCThread.cpp:54) V [jvm.dll+0xc7f154] Thread::call_run+0x1b4 (thread.cpp:365) V [jvm.dll+0xadec7e] thread_native_entry+0xae (os_windows.cpp:544) C [ucrtbase.dll+0x2268a] C [KERNEL32.DLL+0x17974] C [ntdll.dll+0x5a2f1]
19-10-2021