-
Bug
-
Resolution: Unresolved
-
P4
-
26
While experimenting with adding a compile test timeout to tests, I noticed that java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java takes longer than 9 seconds to compile in C1. While this test takes a while to compile due to the large methods, spending this much time in C1 should be investigated. Other VarHandle tests (VarHandleTestByteArrayAsLong.java) also take quite a lot of time (+- 8s) in C1.
When Running java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java with -XX:CompleTaskTimeout=9000 fails with
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/opt/mach5/mesos/work_dir/slaves/526fbd26-20de-495c-9a19-a04adc16f7d1-S15354/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8cd479b8-b847-40ba-a1dc-5fb42403f229/runs/6e6a1873-1954-4769-b90b-6247ca0f783b/workspace/open/src/hotspot/os/linux/compilerThreadTimeout_linux.cpp:47), pid=319252, tid=319276
# assert(false) failed: compile task 1938 (VarHandleTestMethodHandleAccessInt.testInstanceField(LVarHandleTestMethodHandleAccessInt;LVarHandleBaseTest$Handles;)V) timed out after 8000 ms
#
# JRE version: Java(TM) SE Runtime Environment (26.0) (fastdebug build 26-internal-2025-10-27-1017207.manuel.hassig.jdk-JDK-8366447-stress-timeout)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-internal-2025-10-27-1017207.manuel.hassig.jdk-JDK-8366447-stress-timeout, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xbaf4d5] CompilerThreadTimeoutLinux::compiler_signal_handler(int, siginfo*, void*)+0xd5
#
--------------- T H R E A D ---------------
Current thread (0x00007fb7ac1420b0): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=319276, stack(0x00007fb7e6cee000,0x00007fb7e6dee000) (1024K)]
Current CompileTask:
C2:14087 1938 4 VarHandleTestMethodHandleAccessInt::testInstanceField (1729 bytes)
Stack: [0x00007fb7e6cee000,0x00007fb7e6dee000], sp=0x00007fb7e6de81c0, free space=1000k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xbaf4d5] CompilerThreadTimeoutLinux::compiler_signal_handler(int, siginfo*, void*)+0xd5 (compilerThreadTimeout_linux.cpp:47)
C [libc.so.6+0x4e670]
V [libjvm.so+0x1850925] PhaseIterGVN::transform_old(Node*)+0x75 (phaseX.cpp:2111)
V [libjvm.so+0x1855195] PhaseIterGVN::optimize()+0xc5 (phaseX.cpp:1054)
V [libjvm.so+0xb796c7] Compile::Optimize()+0x14a7 (compile.cpp:2419)
V [libjvm.so+0xb7c16f] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x20ff (compile.cpp:861)
V [libjvm.so+0x9981b3] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4a3 (c2compiler.cpp:147)
V [libjvm.so+0xb8b670] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
V [libjvm.so+0xb8ced0] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
V [libjvm.so+0x10e2e0b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:775)
V [libjvm.so+0x1b53ac6] Thread::call_run()+0xb6 (thread.cpp:243)
V [libjvm.so+0x17bf218] thread_native_entry(Thread*)+0x128 (os_linux.cpp:898)
When Running java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java with -XX:CompleTaskTimeout=9000 fails with
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/opt/mach5/mesos/work_dir/slaves/526fbd26-20de-495c-9a19-a04adc16f7d1-S15354/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8cd479b8-b847-40ba-a1dc-5fb42403f229/runs/6e6a1873-1954-4769-b90b-6247ca0f783b/workspace/open/src/hotspot/os/linux/compilerThreadTimeout_linux.cpp:47), pid=319252, tid=319276
# assert(false) failed: compile task 1938 (VarHandleTestMethodHandleAccessInt.testInstanceField(LVarHandleTestMethodHandleAccessInt;LVarHandleBaseTest$Handles;)V) timed out after 8000 ms
#
# JRE version: Java(TM) SE Runtime Environment (26.0) (fastdebug build 26-internal-2025-10-27-1017207.manuel.hassig.jdk-JDK-8366447-stress-timeout)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-internal-2025-10-27-1017207.manuel.hassig.jdk-JDK-8366447-stress-timeout, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xbaf4d5] CompilerThreadTimeoutLinux::compiler_signal_handler(int, siginfo*, void*)+0xd5
#
--------------- T H R E A D ---------------
Current thread (0x00007fb7ac1420b0): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=319276, stack(0x00007fb7e6cee000,0x00007fb7e6dee000) (1024K)]
Current CompileTask:
C2:14087 1938 4 VarHandleTestMethodHandleAccessInt::testInstanceField (1729 bytes)
Stack: [0x00007fb7e6cee000,0x00007fb7e6dee000], sp=0x00007fb7e6de81c0, free space=1000k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xbaf4d5] CompilerThreadTimeoutLinux::compiler_signal_handler(int, siginfo*, void*)+0xd5 (compilerThreadTimeout_linux.cpp:47)
C [libc.so.6+0x4e670]
V [libjvm.so+0x1850925] PhaseIterGVN::transform_old(Node*)+0x75 (phaseX.cpp:2111)
V [libjvm.so+0x1855195] PhaseIterGVN::optimize()+0xc5 (phaseX.cpp:1054)
V [libjvm.so+0xb796c7] Compile::Optimize()+0x14a7 (compile.cpp:2419)
V [libjvm.so+0xb7c16f] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x20ff (compile.cpp:861)
V [libjvm.so+0x9981b3] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4a3 (c2compiler.cpp:147)
V [libjvm.so+0xb8b670] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
V [libjvm.so+0xb8ced0] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
V [libjvm.so+0x10e2e0b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:775)
V [libjvm.so+0x1b53ac6] Thread::call_run()+0xb6 (thread.cpp:243)
V [libjvm.so+0x17bf218] thread_native_entry(Thread*)+0x128 (os_linux.cpp:898)