JDK-8278987 : RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in __write_sample_info__
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 18
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2021-12-19
  • Updated: 2024-04-22
  • Resolved: 2024-04-22
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 17 JDK 18 JDK 19
17.0.12-oracleFixed 18 b30Fixed 19Fixed
Related Reports
Duplicate :  
Relates :  
Description
The following test failed in an Adhoc JDK18 job set:

applications/runthese/RunThese24H.java

Here's a snippet from the log file:

[stress.process.out] [26355.384s][info ][gc          ] GC(1758) Pause Young (Normal) (G1 Evacuation Pause) 1988M->1008M(2400M) 32.458ms
[stress.process.out] [26370.025s][info ][gc          ] GC(1759) Pause Young (Normal) (G1 Evacuation Pause) 1984M->1014M(2400M) 33.160ms
[stress.process.out] [26384.907s][info ][gc          ] GC(1760) Pause Young (Normal) (G1 Evacuation Pause) 2022M->1014M(2400M) 28.079ms
[stress.process.out] #
[stress.process.out] # A fatal error has been detected by the Java Runtime Environment:
[stress.process.out] #
[stress.process.out] #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffa3b522a7f, pid=7060, tid=7496
[stress.process.out] #
[stress.process.out] # JRE version: Java(TM) SE Runtime Environment (18.0) (build 18-internal+0-2021-12-16-2319118.daniel.daugherty.8273107forjdk18.git)
[stress.process.out] # Java VM: Java HotSpot(TM) 64-Bit Server VM (18-internal+0-2021-12-16-2319118.daniel.daugherty.8273107forjdk18.git, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
[stress.process.out] # Problematic frame:
[stress.process.out] # V  [jvm.dll+0x682a7f]  __write_sample_info__+0xaf
[stress.process.out] #
[stress.process.out] # Core dump will be written. Default location: T:\\testoutput\\test-support\\jtreg_closed_test_hotspot_jtreg_applications_runthese_RunThese24H_java\\scratch\\0\\hs_err_pid7060.mdmp
[stress.process.out] #
[stress.process.out] # JFR recording file will be written. Location: T:\\testoutput\\test-support\\jtreg_closed_test_hotspot_jtreg_applications_runthese_RunThese24H_java\\scratch\\0\\hs_err_pid7060.jfr
[stress.process.out] #
[stress.process.out] Unsupported internal testing APIs have been used.
[stress.process.out] 
[stress.process.out] # An error report file with more information is saved as:
[stress.process.out] # T:\\testoutput\\test-support\\jtreg_closed_test_hotspot_jtreg_applications_runthese_RunThese24H_java\\scratch\\0\\hs_err_pid7060.log
[stress.process.out] #
[stress.process.out] # If you would like to submit a bug report, please visit:
[stress.process.out] #   https://bugreport.java.com/bugreport/crash.jsp
[stress.process.out] #
[2021-12-18T12:07:39.857630300Z] Gathering output for process 9804
[2021-12-18T12:07:40.925926100Z] Waiting for completion for process 9804
[2021-12-18T12:07:40.925926100Z] Waiting for completion finished for process 9804
Output and diagnostic info for process 9804 was saved into 'pid-9804-output.log'
[2021-12-18T12:07:40.925926100Z] Gathering output for process 2392
[2021-12-18T12:07:41.050922500Z] Waiting for completion for process 2392
[2021-12-18T12:07:41.050922500Z] Waiting for completion finished for process 2392
Output and diagnostic info for process 2392 was saved into 'pid-2392-output.log'
[2021-12-18T12:07:41.050922500Z] Gathering output for process 9896
[2021-12-18T12:07:41.160323700Z] Waiting for completion for process 9896
[2021-12-18T12:07:41.160323700Z] Waiting for completion finished for process 9896
Output and diagnostic info for process 9896 was saved into 'pid-9896-output.log'
[2021-12-18T12:07:41.160323700Z] Gathering output for process 10212
[2021-12-18T12:07:41.332226Z] Waiting for completion for process 10212
[2021-12-18T12:07:41.332226Z] Waiting for completion finished for process 10212
Output and diagnostic info for process 10212 was saved into 'pid-10212-output.log'


Stress process failed. See stress.process.err/stress.process.out files for details.


Here's the crashing thread's stack:

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

Current thread (0x000001bb7b568d10):  JavaThread "JfrStressModule" [_thread_in_vm, id=7496, stack(0x0000001afa600000,0x0000001afa700000)]

Stack: [0x0000001afa600000,0x0000001afa700000],  sp=0x0000001afa6fefa0,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x682a7f]  __write_sample_info__+0xaf  (objectSampleWriter.cpp:210)
V  [jvm.dll+0x6823a1]  ObjectSampleWriter::~ObjectSampleWriter+0xc1  (objectSampleWriter.cpp:623)
V  [jvm.dll+0x68087d]  ObjectSampleCheckpoint::_write+0x15d  (objectSampleCheckpoint.cpp:396)
V  [jvm.dll+0x2d6e8b]  EventEmitter::emit+0x1ab  (eventEmitter.cpp:64)
V  [jvm.dll+0x56473a]  LeakProfiler::emit_events+0x3a  (leakProfiler.cpp:89)
V  [jvm.dll+0x3c7efc]  jfr_emit_old_object_samples+0x9c  (jfrJniMethod.cpp:355)
C  0x000001bb2c151366

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jdk.jfr.internal.JVM.emitOldObjectSamples(JZZ)V+0 jdk.jfr@18-internal
j  jdk.jfr.internal.OldObjectSample.emit(J)V+14 jdk.jfr@18-internal
j  jdk.jfr.internal.OldObjectSample.emit(Ljdk/jfr/internal/PlatformRecording;)V+31 jdk.jfr@18-internal
j  jdk.jfr.internal.PlatformRecorder.stop(Ljdk/jfr/internal/PlatformRecording;)V+142 jdk.jfr@18-internal
j  jdk.jfr.internal.PlatformRecording.stop(Ljava/lang/String;)Z+38 jdk.jfr@18-internal
j  jdk.jfr.Recording.stop()Z+6 jdk.jfr@18-internal
j  applications.kitchensink.process.stress.modules.JfrStressModule.execute()V+94
j  applications.kitchensink.process.stress.modules.StressModule.run()V+109
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000008
Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk17u-dev/pull/63 Date: 2022-01-06 15:48:18 +0000
06-01-2022

[17u] Fix Request I would like to ask for an approval to backport this fix to JDK 17u. It is a required follow-up fix to JDK-8277919. The fix applies cleanly. jdk_jfr tests were run and they are all passing. The PR will be open once JDK-8277919 backport has been integrated and this request will be updated to contain the link to that PR.
27-12-2021

The fix for this bug is in jdk-18+29-2008.
23-12-2021

Changeset: 713fbeb0 Author: Markus Grönlund <mgronlun@openjdk.org> Date: 2021-12-22 12:30:55 +0000 URL: https://git.openjdk.java.net/jdk18/commit/713fbeb050a8f79d3a662106125c3f14f3952741
22-12-2021

JDK-8277919 added the following to build the stacktrace blob's in the thread doing the serialization: ... { // First install stacktrace blobs for the most recently added candidates. MutexLocker lock(SafepointSynchronize::is_at_safepoint() ? nullptr : ClassLoaderDataGraph_lock); // the lock is needed to ensure the unload lists do not grow in the middle of inspection. install_stack_traces(sampler); } ClassLoaderDataGraph_lock is taken with safepoint check. This means there is now a potential safepoint in the serialization code where previously there was none. During the safepoint, the leak candidate objects on the list to be serialized can be gc:ed. Indeed, the crash happens when trying to get the klass for a leak candidate object.
20-12-2021

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18/pull/47 Date: 2021-12-19 17:13:39 +0000
19-12-2021