-
Bug
-
Resolution: Fixed
-
P3
-
21
-
b11
-
ppc
# Symptom
The test compiler/codecache/TestStressCodeBuffers.java often crashes after continuations are enabled by default (JDK-8301819)
# Analysis
The tests causes CodeBuffer::expand() to fail in increasing intervals. There are execution paths that lack a check if C2 compilation is failing before calling MacroAssembler::post_call_nop() where the crash happens when the nop instruction is written after code buffer expansion failed.
Crashes happen afterJDK-8301819 because post_call_nop() does not emit instructions if continuations are disabled.
# Head of hs_err log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007581321f16c0, pid=88435, tid=88450
#
# JRE version: OpenJDK Runtime Environment (21.0) (fastdebug build 21-internal-adhoc.openjdk.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 21-internal-adhoc.openjdk.jdk, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-ppc64le)
# Problematic frame:
# V [libjvm.so+0x14416c0] Assembler::ori(Register, Register, int) [clone .constprop.101]+0x60
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to .../.../JTwork/scratch/core.88435)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
--------------- S U M M A R Y ------------
Command Line: -Dtest.vm.opts=-Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=.../.../tmp -Djava.io.tmpdir=.../.../tmp -Dtest.getfreeport.max.tries=40 -ea -esa -Dtest.tool.vm.opts=-J-Xmx768m -J-Djava.awt.headless=true -J-Djava.util.prefs.userRoot=.../.../tmp -J-Djava.io.tmpdir=.../.../tmp -J-Dtest.getfreeport.max.tries=40 -J-ea -J-esa -Dtest.compiler.opts= -Dtest.java.opts= -Dtest.jdk=.../sapjvm_21 -Dcompile.jdk=.../sapjvm_21 -Dtest.timeout.factor=6.0 -Dtest.nativepath=.../.../test/hotspot/jtreg/native -Dtest.root=.../.../test/hotspot/jtreg -Dtest.name=compiler/codecache/TestStressCodeBuffers.java -Dtest.file=.../.../test/hotspot/jtreg/compiler/codecache/TestStressCodeBuffers.java -Dtest.src=.../.../test/hotspot/jtreg/compiler/codecache -Dtest.src.path=.../.../test/hotspot/jtreg/compiler/codecache -Dtest.classes=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d -Dtest.class.path=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d -Dtest.class.path.prefix=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d:.../.../test/hotspot/jtreg/compiler/codecache -Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=.../.../tmp -Djava.io.tmpdir=.../.../tmp -Dtest.getfreeport.max.tries=40 -ea -esa -Djava.library.path=.../.../test/hotspot/jtreg/native -Xcomp -XX:-TieredCompilation -XX:+StressCodeBuffers com.sun.javatest.regtest.agent.MainWrapper .../.../JTwork/compiler/codecache/TestStressCodeBuffers.d/main.0.jta
Host: ..., POWER9 (architected), altivec supported, 128 cores, 54G, Ubuntu 18.04.3 LTS
Time: Sun Feb 12 22:51:42 2023 CET elapsed time: 1.024270 seconds (0d 0h 0m 1s)
--------------- T H R E A D ---------------
Current thread (0x000075812c4faef0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=88450, stack(0x00007580fb400000,0x00007580fb800000)]
Current CompileTask:
C2: 1024 126 b java.lang.invoke.MethodHandles$Lookup::unreflectField (126 bytes)
Stack: [0x00007580fb400000,0x00007580fb800000], sp=0x00007580fb7fa080, free space=4072k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x14416c0] Assembler::ori(Register, Register, int) [clone .constprop.101]+0x60 (codeBuffer.hpp:239)
V [libjvm.so+0x1448e54] MacroAssembler::post_call_nop()+0x54 (assembler_ppc.inline.hpp:245)
V [libjvm.so+0x30fd4c] CallStaticJavaDirectNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x37c (ppc.ad:3453)
V [libjvm.so+0x16be5c4] PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0x594 (output.cpp:1617)
V [libjvm.so+0x9aa098] Compile::Code_Gen()+0x4e8 (compile.cpp:2971)
V [libjvm.so+0x9ae9d4] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1604 (compile.cpp:866)
V [libjvm.so+0x73e1ac] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x21c (c2compiler.cpp:113)
V [libjvm.so+0x9bf990] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xaf0 (compileBroker.cpp:2237)
V [libjvm.so+0x9c0498] CompileBroker::compiler_thread_loop()+0x6d8 (compileBroker.cpp:1916)
V [libjvm.so+0x9f7d34] CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x44 (compilerThread.cpp:58)
V [libjvm.so+0xfdfbe0] JavaThread::thread_main_inner()+0x2c0 (javaThread.cpp:710)
V [libjvm.so+0x1b95508] Thread::call_run()+0x148 (thread.cpp:224)
V [libjvm.so+0x168de94] thread_native_entry(Thread*)+0x174 (os_linux.cpp:737)
C [libpthread.so.0+0x885c] start_thread+0x10c
siginfo: si_signo: 11 (SIGSEGV), si_code: 3 (unknown), si_addr: 0xfffffffffffffffe
The test compiler/codecache/TestStressCodeBuffers.java often crashes after continuations are enabled by default (
# Analysis
The tests causes CodeBuffer::expand() to fail in increasing intervals. There are execution paths that lack a check if C2 compilation is failing before calling MacroAssembler::post_call_nop() where the crash happens when the nop instruction is written after code buffer expansion failed.
Crashes happen after
# Head of hs_err log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007581321f16c0, pid=88435, tid=88450
#
# JRE version: OpenJDK Runtime Environment (21.0) (fastdebug build 21-internal-adhoc.openjdk.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 21-internal-adhoc.openjdk.jdk, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-ppc64le)
# Problematic frame:
# V [libjvm.so+0x14416c0] Assembler::ori(Register, Register, int) [clone .constprop.101]+0x60
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to .../.../JTwork/scratch/core.88435)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
--------------- S U M M A R Y ------------
Command Line: -Dtest.vm.opts=-Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=.../.../tmp -Djava.io.tmpdir=.../.../tmp -Dtest.getfreeport.max.tries=40 -ea -esa -Dtest.tool.vm.opts=-J-Xmx768m -J-Djava.awt.headless=true -J-Djava.util.prefs.userRoot=.../.../tmp -J-Djava.io.tmpdir=.../.../tmp -J-Dtest.getfreeport.max.tries=40 -J-ea -J-esa -Dtest.compiler.opts= -Dtest.java.opts= -Dtest.jdk=.../sapjvm_21 -Dcompile.jdk=.../sapjvm_21 -Dtest.timeout.factor=6.0 -Dtest.nativepath=.../.../test/hotspot/jtreg/native -Dtest.root=.../.../test/hotspot/jtreg -Dtest.name=compiler/codecache/TestStressCodeBuffers.java -Dtest.file=.../.../test/hotspot/jtreg/compiler/codecache/TestStressCodeBuffers.java -Dtest.src=.../.../test/hotspot/jtreg/compiler/codecache -Dtest.src.path=.../.../test/hotspot/jtreg/compiler/codecache -Dtest.classes=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d -Dtest.class.path=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d -Dtest.class.path.prefix=.../.../JTwork/classes/compiler/codecache/TestStressCodeBuffers.d:.../.../test/hotspot/jtreg/compiler/codecache -Xmx768m -Djava.awt.headless=true -Djava.util.prefs.userRoot=.../.../tmp -Djava.io.tmpdir=.../.../tmp -Dtest.getfreeport.max.tries=40 -ea -esa -Djava.library.path=.../.../test/hotspot/jtreg/native -Xcomp -XX:-TieredCompilation -XX:+StressCodeBuffers com.sun.javatest.regtest.agent.MainWrapper .../.../JTwork/compiler/codecache/TestStressCodeBuffers.d/main.0.jta
Host: ..., POWER9 (architected), altivec supported, 128 cores, 54G, Ubuntu 18.04.3 LTS
Time: Sun Feb 12 22:51:42 2023 CET elapsed time: 1.024270 seconds (0d 0h 0m 1s)
--------------- T H R E A D ---------------
Current thread (0x000075812c4faef0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=88450, stack(0x00007580fb400000,0x00007580fb800000)]
Current CompileTask:
C2: 1024 126 b java.lang.invoke.MethodHandles$Lookup::unreflectField (126 bytes)
Stack: [0x00007580fb400000,0x00007580fb800000], sp=0x00007580fb7fa080, free space=4072k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x14416c0] Assembler::ori(Register, Register, int) [clone .constprop.101]+0x60 (codeBuffer.hpp:239)
V [libjvm.so+0x1448e54] MacroAssembler::post_call_nop()+0x54 (assembler_ppc.inline.hpp:245)
V [libjvm.so+0x30fd4c] CallStaticJavaDirectNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x37c (ppc.ad:3453)
V [libjvm.so+0x16be5c4] PhaseOutput::fill_buffer(CodeBuffer*, unsigned int*)+0x594 (output.cpp:1617)
V [libjvm.so+0x9aa098] Compile::Code_Gen()+0x4e8 (compile.cpp:2971)
V [libjvm.so+0x9ae9d4] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1604 (compile.cpp:866)
V [libjvm.so+0x73e1ac] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x21c (c2compiler.cpp:113)
V [libjvm.so+0x9bf990] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xaf0 (compileBroker.cpp:2237)
V [libjvm.so+0x9c0498] CompileBroker::compiler_thread_loop()+0x6d8 (compileBroker.cpp:1916)
V [libjvm.so+0x9f7d34] CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x44 (compilerThread.cpp:58)
V [libjvm.so+0xfdfbe0] JavaThread::thread_main_inner()+0x2c0 (javaThread.cpp:710)
V [libjvm.so+0x1b95508] Thread::call_run()+0x148 (thread.cpp:224)
V [libjvm.so+0x168de94] thread_native_entry(Thread*)+0x174 (os_linux.cpp:737)
C [libpthread.so.0+0x885c] start_thread+0x10c
siginfo: si_signo: 11 (SIGSEGV), si_code: 3 (unknown), si_addr: 0xfffffffffffffffe
- relates to
-
JDK-8301819 Enable continuations code by default
-
- Resolved
-