JDK-8286492 : applications/jcstress/seqcst.java failed with SIGSEGV in C2 code
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86_64
  • Submitted: 2022-05-10
  • Updated: 2022-06-03
  • Resolved: 2022-05-23
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 19
19Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK19 CI:

applications/jcstress/seqcst.java

Here's a snippet from the log file:

      [OK] o.o.j.t.seqcst.volatiles.S1__S2__S3__S3_S2_L1_Test
    (JVM args: [-Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/scratch/0, -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/scratch/0, -XX:MaxRAMPercentage=4.16667, -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/tmp])
  Observed state   Occurrences   Expectation  Interpretation                                              
      0, 5, 2, 1     3,431,543    ACCEPTABLE  Sequential consistency.                                     
      0, 5, 2, 3     3,866,592    ACCEPTABLE  Sequential consistency.                                     
      0, 5, 4, 1     2,722,429    ACCEPTABLE  Sequential consistency.                                     
      0, 5, 4, 3     7,174,840    ACCEPTABLE  Sequential consistency.                                     
      5, 5, 2, 1    11,755,956    ACCEPTABLE  Sequential consistency.                                     
      5, 5, 2, 3     4,228,511    ACCEPTABLE  Sequential consistency.                                     
      5, 5, 4, 1     3,180,292    ACCEPTABLE  Sequential consistency.                                     
      5, 5, 4, 3     2,550,808    ACCEPTABLE  Sequential consistency.                                     


------------------------------------------------------------------------------------------------------------------------

HTML report was generated. Look at results/index.html for the complete run results.

Will throw any pending exceptions at this point.
Exception in thread "main" java.lang.AssertionError: TEST FAILURES: 
org.openjdk.jcstress.tests.seqcst.sync.L1_L1_S2__L1_S1__S2_Test [-Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/scratch/0, -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/scratch/0, -XX:MaxRAMPercentage=4.16667, -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/779adf21-f3e5-4e6a-a889-8cc0f9bc6fbb-S14433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/235c88ae-930b-48bc-9431-7a3f6a152675/runs/c7a831b2-b282-4ba5-91d6-0b693f727fd5/testoutput/test-support/jtreg_open_test_hotspot_jtreg_jcstress_part1/tmp] had failed with the VM error.

	at org.openjdk.jcstress.infra.grading.ExceptionReportPrinter.work(ExceptionReportPrinter.java:63)
	at org.openjdk.jcstress.JCStress.parseResults(JCStress.java:101)
	at org.openjdk.jcstress.JCStress.run(JCStress.java:86)
	at org.openjdk.jcstress.Main.main(Main.java:60)
]cout/cerr
java.lang.Error: jctress test finished with nonzero exitcode 1
	at applications.jcstress.JcstressRunner.main(JcstressRunner.java:85)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:1585)

JavaTest Message: Test threw exception: java.lang.Error
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Error: jctress test finished with nonzero exitcode 1

The log does not show signs of the crash, but there is so much
output from the test, JTREG has clipped the output.

Here's snippets from the hs_err_pid file:

#  SIGSEGV (0xb) at pc=0x00007fd2e0c8dd32, pid=8179, tid=8201
#
# JRE version: Java(TM) SE Runtime Environment (19.0+22) (fastdebug build 19-ea+22-1547)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-ea+22-1547, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 1633 c2 org.openjdk.jcstress.tests.seqcst.sync.L1_L1_S2__L2_S2__S1_Test_jcstress.actor1()Lorg/openjdk/jcstress/util/Counter; (113 bytes) @ 0x00007fd2e0c8dd32 [0x00007fd2e0c8d440+0x00000000000008f2]

<snip>

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

Current thread (0x00007fd2f0628960):  JavaThread "jcstress-worker-3" daemon [_thread_in_Java, id=8201, stack(0x00007fd2c51f1000,0x00007fd2c52f2000)]

Stack: [0x00007fd2c51f1000,0x00007fd2c52f2000],  sp=0x00007fd2c52f0720,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 1633 c2 org.openjdk.jcstress.tests.seqcst.sync.L1_L1_S2__L2_S2__S1_Test_jcstress.actor1()Lorg/openjdk/jcstress/util/Counter; (113 bytes) @ 0x00007fd2e0c8dd32 [0x00007fd2e0c8d440+0x00000000000008f2]
j  org.openjdk.jcstress.tests.seqcst.sync.L1_L1_S2__L2_S2__S1_Test_jcstress$$Lambda$65+0x000000080101e620.call()Ljava/lang/Object;+4
j  java.util.concurrent.FutureTask.run()V+39 java.base@19-ea
j  java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@19-ea
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@19-ea
j  java.lang.Thread.run()V+13 java.base@19-ea
v  ~StubRoutines::call_stub 0x00007fd2e055ad47
V  [libjvm.so+0xfd2634]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x504
V  [libjvm.so+0xfd2ee4]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x4b4
V  [libjvm.so+0xfd3357]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0x77
V  [libjvm.so+0x114edfb]  thread_entry(JavaThread*, JavaThread*)+0x12b
V  [libjvm.so+0x1a566ea]  JavaThread::thread_main_inner()+0x21a
V  [libjvm.so+0x1a64030]  Thread::call_run()+0x100
V  [libjvm.so+0x170d894]  thread_native_entry(Thread*)+0x104


siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000

Since the crash is in C2 compiled code, I'm starting this bug
off in hotspot/compiler for initial triage.
Comments
Ran 1000 times on same hardware as crash, but didn't reproduce. Closing as CNR until we have more information.
23-05-2022

The symptoms seem similar to JDK-8263710. The crash seems impossible to explain unless it's an OS, hypervisor, hardware, or cross-modified code bug.
20-05-2022

This failure was on AMD. I couldn't find any failures on Intel in JDK-8235349 or JDK-8264782, but some of the machines/hs_err files are no longer available.
18-05-2022

Event: 24.976 Thread 0x00007fd2f0628960 Implicit null exception at 0x00007fd2e0c8dd32 to 0x0000000000000000 This seems suspicious that no exception handler was found, but what is even stranger is that according to the hs_err file, the instruction is a conditional branch instruction, which shouldn't be causing a SEGV.
16-05-2022

ILW = crash in compiled method; rare with one reproducer test; no workaround = HLH = P2
11-05-2022

There are a couple other bugs against this test where the failure mode was "strange" and the bug was closed as CNR: JDK-8235349 applications/jcstress/seqcst.java crashes due to SIGSEGV JDK-8264782 applications/jcstress/seqcst.java SIGILL in ObjectSynchronizer::quick_enter This bug's failure mode does not match the two older bugs and looks more promising (to me anyway).
10-05-2022