compiler/vectorapi/TestVectorShiftImm.java fails with "assert(false) failed: Attempting to acquire lock StackWatermark_lock/9 out of order with lock tty_lock/3 -- possible deadlock detected.
The following test failed in the JDK18 CI:
compiler/vectorapi/TestVectorShiftImm.java
The log file has a garbled portion of the crash mess:
1034 B140: # out( N1 ) <- in( B23 ) Freq: 4.7682e-07
1034 + spill R1 -> [sp, #40] # spill size = 32
1038 + spill R3 -> [sp, #56] # spill size = 32
103c + spill R11 -> [sp, #44] # spill size = 32
1040 + spill R17 -> [sp, #32] # spill size = 64
1044 + spill R19 -> [sp, #24] # spill size = 64
1044 + mov R1, #-187 # int
1048 spill R15 -> [sp, #8] # spill size = 64
104c call,static 0x00000001100d5140 // ==> wrapper for: uncommon_trap(reason='unstable_if' action='reinterpret' debug_id='0')
# jdk.incubator.vector.VectorOperators$OperatorImpl::opCode @ bci:26 (line 830) L[0]=sp + #24 L[1]=#2048 L[2]=#512#
# Compiler replay data is saved as:
# L[3]=sp + #44/System/Volumes/Data/mesos/work_dir/slaves/a2dc162d-743b-4800-9e92-31f85abb45b1-S16/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/95b84b56-03ec-44a6-8c93-1d134ddc92de/runs/c2fdfe43-31e6-4076-ab6c-94c8610f8622/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_compiler_all_gcs/scratch/2/replay_pid63454.log
STK[0]=R29 STK[1]=#512
# jdk.incubator.vector.VectorOperators::opCode @ bci:6 (line 403) L[0]=_ L[1]=_ L[2]=_
# jdk.incubator.vector.ByteVector::opCode @ bci:7 (line 63) L[0]=_
# jdk.incubator.vector.ByteVector::lanewiseShiftTemplate @ bci:29 (line 806) L[0]=sp + #48 L[1]=sp + #16 L[2]=#1 L[3]=_
##
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
jdk.incubator.vector.Byte64Vector::
----------System.err:(1/55)----------
WARNING: Using incubator modules: jdk.incubator.vector
----------rerun:(41/6424)*----------
Here's snippets from the hs_err_pid file:
# Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/a2dc162d-743b-4800-9e92-31f85abb45b1-S22/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c8ef3af4-816b-4614-a062-bed26f74e970/runs/c297bafa-efc6-40a8-971f-ba31f46b3e2d/workspace/open/src/hotspot/share/runtime/mutex.cpp:415), pid=63454, tid=25603
# assert(false) failed: Attempting to acquire lock StackWatermark_lock/9 out of order with lock tty_lock/3 -- possible deadlock
#
# JRE version: Java(TM) SE Runtime Environment (18.0+15) (fastdebug build 18-ea+15-786)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+15-786, mixed mode, sharing, compressed class ptrs, z gc, bsd-aarch64)
# Core dump will be written. Default location: core.63454
<snip>
--------------- T H R E A D ---------------
Current thread (0x000000011600a420): JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=25603, stack(0x0000000172448000,0x000000017264b000)]
Current CompileTask:
C2: 1099 385 % compiler.vectorapi.TestVectorShiftImm::shift_and_accumulate @ 20 (144 bytes)
Stack: [0x0000000172448000,0x000000017264b000], sp=0x0000000172646660, free space=2041k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0xfadac4] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x5d8
V [libjvm.dylib+0xfae200] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40
V [libjvm.dylib+0x501198] report_vm_error(char const*, int, char const*, char const*, ...)+0x80
V [libjvm.dylib+0xc7e84c] Mutex::check_rank(Thread*)+0x30c
V [libjvm.dylib+0xc7ea14] Mutex::lock_without_safepoint_check(Thread*)+0x60
V [libjvm.dylib+0xe22514] StackWatermark::on_safepoint()+0x3c
V [libjvm.dylib+0xdd1544] SafepointMechanism::process(JavaThread*, bool)+0x90
V [libjvm.dylib+0x41ee90] ThreadStateTransition::transition_from_native(JavaThread*, JavaThreadState, bool)+0x1c0
V [libjvm.dylib+0x41ec8c] ThreadInVMfromNative::ThreadInVMfromNative(JavaThread*)+0xb4
V [libjvm.dylib+0x436f48] ciSymbol::as_utf8()+0x40
V [libjvm.dylib+0xf3cc40] TypeKlassPtr::dump2(Dict&, unsigned int, outputStream*) const+0x58
V [libjvm.dylib+0xf2f4a4] Type::dump_on(outputStream*) const+0x9c
V [libjvm.dylib+0x12e750] loadConNKlassNode::format(PhaseRegAlloc*, outputStream*) const+0xec
V [libjvm.dylib+0xcfcd50] PhaseOutput::dump_asm_on(outputStream*, int*, unsigned int)+0x7dc
V [libjvm.dylib+0xcf48ec] PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0x2088
V [libjvm.dylib+0x4ad374] Compile::Code_Gen()+0x480
V [libjvm.dylib+0x4aad4c] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x1554
V [libjvm.dylib+0x3a9c7c] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x134
V [libjvm.dylib+0x4c5900] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x604
V [libjvm.dylib+0x4c50fc] CompileBroker::compiler_thread_loop()+0x2c0
V [libjvm.dylib+0xf0f218] JavaThread::thread_main_inner()+0x254
V [libjvm.dylib+0xf0c4f0] Thread::call_run()+0x21c
V [libjvm.dylib+0xce1640] thread_native_entry(Thread*)+0x160
C [libsystem_pthread.dylib+0x7878] _pthread_start+0x140
I'm starting this bug in hotspot/compiler since this is a compiler
test and we're crashing in compiler code, but [~coleenp] has
been recently working on the internal locks so I'm going to
send this bug her way for an initial evaluation.