JDK-8343003 : assert(lower->pc_offset() < pc_offset) failed: sanity
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 24
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2024-10-24
  • Updated: 2025-05-30
  • Resolved: 2025-05-26
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 25
25 masterResolved
Related Reports
Blocks :  
Duplicate :  
Description
While trying to reproduce a compiler issue, I repeatedly ran RenaissanceStressTest.java with -XX:+UseZGC with a custom build. One out of 200 runs failed with the following assertion which suggests it's probably an unrelated JFR issue:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/7a20d425-e769-4142-b5c1-e3cc2d88e03e-S63415/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/fe88d69b-13b2-4074-b609-8166235b0565/runs/f842bff8-d181-49b9-9da7-9f75f5b52966/workspace/open/src/hotspot/share/code/nmethod.cpp:2774), pid=1001707, tid=1001809
#  assert(lower->pc_offset() < pc_offset) failed: sanity
#
# JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-2024-10-17-2036340.mandy.chung.closed-jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-2024-10-17-2036340.mandy.chung.closed-jdk, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1473b62]  PcDescContainer::find_pc_desc_internal(unsigned char*, bool, unsigned char*, PcDesc*, PcDesc*)+0x4f2
.................
Command Line: -Xbootclasspath/a:/opt/mach5/mesos/work_dir/slaves/ccd15758-3c17-44a6-a32a-40698b0633d8-S15254/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/486971eb-1cb1-444b-a47f-a0dbac7275b7/runs/1c315ad5-e2b9-41b1-a67f-79a2012157b0/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_renaissance_RenaissanceStressTest_java/scratch/0/wb.jar -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/23/37/bundles/linux-x64/jdk-23_linux-x64_bin.tar.gz/jdk-23 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/ccd15758-3c17-44a6-a32a-40698b0633d8-S15254/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/486971eb-1cb1-444b-a47f-a0dbac7275b7/runs/1c315ad5-e2b9-41b1-a67f-79a2012157b0/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_renaissance_RenaissanceStressTest_java/tmp -XX:+UseZGC -Dakka.logger-startup-timeout=120s -XX:MaxRAMPercentage=25 -XX:MaxMetaspaceSize=20256m -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError -Djava.net.preferIPv6Addresses=false -XX:+DisplayVMOutputToStderr -Xlog:gc*,gc+heap=debug:gc.log:uptime,timemillis,level,tags -XX:+DisableExplicitGC -XX:+StartAttachListener -XX:CompileCommand=memlimit,*.*,0 -Djava.security.manager=allow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/ccd15758-3c17-44a6-a32a-40698b0633d8-S15254/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/486971eb-1cb1-444b-a47f-a0dbac7275b7/runs/1c315ad5-e2b9-41b1-a67f-79a2012157b0/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_renaissance_RenaissanceStressTest_java/scratch/0/java.io.tmpdir -Duser.home=/opt/mach5/mesos/work_dir/slaves/ccd15758-3c17-44a6-a32a-40698b0633d8-S15254/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/486971eb-1cb1-444b-a47f-a0dbac7275b7/runs/1c315ad5-e2b9-41b1-a67f-79a2012157b0/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_renaissance_RenaissanceStressTest_java/scratch/0/user.home -agentpath:/opt/mach5/mesos/work_dir/jib-master/install/2024-10-17-2036340.mandy.chung.closed-jdk/linux-x64-debug.test/hotspot/jtreg/native/libJvmtiStressModule.so -XX:NativeMemoryTracking=detail -Djdk.test.lib.random.seed=3582779658499331280 applications.kitchensink.process.stress.Main /opt/mach5/mesos/work_dir/slaves/ccd15758-3c17-44a6-a32a-40698b0633d8-S15254/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/486971eb-1cb1-444b-a47f-a0dbac7275b7/runs/1c315ad5-e2b9-41b1-a67f-79a2012157b0/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_renaissance_RenaissanceStressTest_java/scratch/0/kitchensink.final.properties
...........
Current thread (0x00007f5f15047640):  JfrThreadSampler "JFR Thread Sampler" [id=1001809, stack(0x00007f5fcd54b000,0x00007f5fcd64b000) (1024K)] _threads_hazard_ptr=0x00007f5ea40323b0, _nested_threads_hazard_ptr_cnt=0

Stack: [0x00007f5fcd54b000,0x00007f5fcd64b000],  sp=0x00007f5fcd648350,  free space=1012k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1473b62]  PcDescContainer::find_pc_desc_internal(unsigned char*, bool, unsigned char*, PcDesc*, PcDesc*)+0x4f2  (nmethod.cpp:2774)
V  [libjvm.so+0xf8df3b]  JfrVframeStream::next_vframe()+0x74b  (nmethod.hpp:358)
V  [libjvm.so+0xf8f1e1]  JfrStackTrace::record_async(JavaThread*, frame const&)+0xf1  (jfrStackTrace.cpp:272)
V  [libjvm.so+0xfad491]  OSThreadSampler::protected_task(SuspendedThreadTaskContext const&)+0xb1  (jfrThreadSampler.cpp:194)
V  [libjvm.so+0x16a5357]  SuspendedThreadTask::internal_do_task()+0x47  (signals_posix.cpp:1831)
V  [libjvm.so+0x17a3e71]  SuspendedThreadTask::run()+0x11  (suspendedThreadTask.cpp:30)
V  [libjvm.so+0xfad61f]  JfrThreadSampleClosure::sample_thread_in_java(JavaThread*, JfrStackFrame*, unsigned int)+0x8f  (jfrThreadSampler.cpp:210)
V  [libjvm.so+0xfae2e3]  JfrThreadSampleClosure::do_sample_thread(JavaThread*, JfrStackFrame*, unsigned int, JfrSampleType)+0x2f3  (jfrThreadSampler.cpp:408)
V  [libjvm.so+0xfb1d7e]  JfrThreadSampler::task_stacktrace(JfrSampleType, JavaThread**) [clone .constprop.1]+0x30e  (jfrThreadSampler.cpp:627)
V  [libjvm.so+0xfb25b4]  JfrThreadSampler::run()+0x244  (jfrThreadSampler.cpp:561)
V  [libjvm.so+0x1819cf6]  Thread::call_run()+0xb6  (thread.cpp:234)
V  [libjvm.so+0x14fb7a8]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:858)
Comments
Thanks for reporting [~chagedorn], I have linked JDK-8321098 which will make the JFR sampler more robust when combined with concurrent GCs, such as ZGC.
25-10-2024