JDK-8240680 : Various crashes in C2's register allocator
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2020-03-06
  • Updated: 2020-03-17
  • Resolved: 2020-03-17
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 15
15Resolved
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
The following test failed in the JDK15 CI:

gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java

Here's a snippet from the log file:

#section:main
----------messages:(5/655)----------
command: main -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -XX:G1HeapRegionSize=1M gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS
reason: User specified action: run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. -XX:G1HeapRegionSize=1M gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base,java.management --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
elapsed time (seconds): 18.546
----------configuration:(4/111)----------
Boot Layer
  add modules: java.base java.management   
  add exports: java.base/jdk.internal.misc ALL-UNNAMED

----------System.out:(27/1542)----------
[2020-03-06T10:08:08.526665Z] Gathering output for process 54514
[2020-03-06T10:08:08.868181Z] Waiting for completion for process 54514
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010987a406, pid=54512, tid=24579
#
# JRE version: Java(TM) SE Runtime Environment (15.0+14) (fastdebug build 15-ea+14-506)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 15-ea+14-506, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# V  [libjvm.dylib+0x27a406]  IndexSet::insert(unsigned int)+0x3e
#
# Core dump will be written. Default location: core.54512
#
Unsupported internal testing APIs have been used.

# An error report file with more information is saved as:
# /mesos/work_dir/slaves/7cfa21b9-afde-4338-a459-d3e0a13ec793-S1176/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a3ef3fac-36fb-4b84-834b-698120fc83be/runs/f2e22799-72c5-450d-b4ab-af4a6651a728/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_gc/scratch/0/hs_err_pid54512.log
#
# Compiler replay data is saved as:
# /mesos/work_dir/slaves/7cfa21b9-afde-4338-a459-d3e0a13ec793-S1176/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a3ef3fac-36fb-4b84-834b-698120fc83be/runs/f2e22799-72c5-450d-b4ab-af4a6651a728/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_gc/scratch/0/replay_pid54512.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
Current thread is 24579
Dumping core ...
----------System.err:(3/172)----------
java version "15-ea" 2020-09-15
Java(TM) SE Runtime Environment (fastdebug build 15-ea+14-506)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 15-ea+14-506, mixed mode)
----------rerun:(43/7121)*----------


Here's the crashing thread's stack: 

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

Current thread (0x00007ff58a800800):  JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=24579, stack(0x000070000916b000,0x000070000926b000)]


Current CompileTask:
C2:  12508  401       4       java.util.regex.Pattern$GroupHead::match (47 bytes)

Stack: [0x000070000916b000,0x000070000926b000],  sp=0x0000700009267150,  free space=1008k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x27a406]  IndexSet::insert(unsigned int)+0x3e
V  [libjvm.dylib+0x4f6c92]  PhaseIFG::SquareUp()+0x80
V  [libjvm.dylib+0x276176]  PhaseChaitin::Register_Allocate()+0x768
V  [libjvm.dylib+0x304280]  Compile::Code_Gen()+0x2ba
V  [libjvm.dylib+0x30201d]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xbf1
V  [libjvm.dylib+0x254096]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xe8
V  [libjvm.dylib+0x3141fb]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x555
V  [libjvm.dylib+0x313a9b]  CompileBroker::compiler_thread_loop()+0x283
V  [libjvm.dylib+0xabb521]  JavaThread::thread_main_inner()+0x193
V  [libjvm.dylib+0xab7cfb]  Thread::call_run()+0x11b
V  [libjvm.dylib+0x931694]  thread_native_entry(Thread*)+0xe0
C  [libsystem_pthread.dylib+0x3661]  _pthread_body+0x154
C  [libsystem_pthread.dylib+0x350d]  _pthread_body+0x0
C  [libsystem_pthread.dylib+0x2bf9]  thread_start+0xd


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

Comments
I'm closing this because the issue did not show up anymore since March 7 and JDK-8238384 has been backed out.
17-03-2020

Also see JDK-8240702 and JDK-8240703, which also both turned up only on this device. They do not look to be C2 related, so maybe this is a problem with the device and not C2. The other thing to note about JDK-8240702 and JDK-8240703 is that they both ran into issues when the test invoked javac (via java, not command line).
10-03-2020

ILW = Crash in C2's register allocator, very intermittent with different tests, no known workaround (but disable compilation) = HLH = P2 These failures first showed up on March 6. I suspect that they might be another regression from JDK-8238384 which is also suspected to have caused JDK-8240553. [~roland], what do you think?
10-03-2020

I've closed JDK-8240706 as duplicate of this one. # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/scratch/mesos/slaves/b0d836b1-c68c-4dbd-8b78-5085890ddd4c-S17/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/180f4b9b-5412-452a-8a1e-e2b74b06d823/runs/db56e059-8738-4f13-b82e-fa13230fb696/workspace/open/src/hotspot/share/opto/regmask.hpp:204), pid=89294, tid=22787 # assert(_A[i] == 0) failed: _hwm too low: 0 regs at: 7 Current CompileTask: C2: 9539 1012 4 java.text.DecimalFormat::applyPattern (1645 bytes) Stack: [0x0000700007815000,0x0000700007915000], sp=0x0000700007910b00, free space=1006k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.dylib+0xb449c7] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6e5 V [libjvm.dylib+0xb450e3] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x47 V [libjvm.dylib+0x3382fc] report_vm_error(char const*, int, char const*, char const*, ...)+0x145 V [libjvm.dylib+0x25f51a] RegMask::valid_watermarks() const+0x10e V [libjvm.dylib+0x2e5338] RegMask::overlap(RegMask const&) const+0x12 V [libjvm.dylib+0x9c0642] RegMask::is_UP() const+0x16 V [libjvm.dylib+0x4f8064] PhaseChaitin::raise_pressure(Block*, LRG&, PhaseChaitin::Pressure&, PhaseChaitin::Pressure&)+0x20 V [libjvm.dylib+0x4f8a84] PhaseChaitin::add_input_to_liveout(Block*, Node*, IndexSet*, double, PhaseChaitin::Pressure&, PhaseChaitin::Pressure&)+0x122 V [libjvm.dylib+0x4f9212] PhaseChaitin::build_ifg_physical(ResourceArea*)+0x5a6 V [libjvm.dylib+0x276316] PhaseChaitin::Register_Allocate()+0x75c V [libjvm.dylib+0x30457a] Compile::Code_Gen()+0x2ba V [libjvm.dylib+0x3021cb] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xbf1 V [libjvm.dylib+0x2541fa] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xe8 V [libjvm.dylib+0x31446b] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x555 V [libjvm.dylib+0x313d0b] CompileBroker::compiler_thread_loop()+0x283 V [libjvm.dylib+0xabb8e5] JavaThread::thread_main_inner()+0x193 V [libjvm.dylib+0xab80bf] Thread::call_run()+0x11b V [libjvm.dylib+0x9317ec] thread_native_entry(Thread*)+0xe0 C [libsystem_pthread.dylib+0x3661] _pthread_body+0x154 C [libsystem_pthread.dylib+0x350d] _pthread_body+0x0 C [libsystem_pthread.dylib+0x2bf9] thread_start+0xd
10-03-2020