Details
-
Bug
-
Resolution: Fixed
-
P2
-
22
-
b19
-
Verified
Description
Method::build_profiling_method_data is the normal way to create MethodData for a Method and it uses an atomic to do the write. c2v_getFailedSpeculationAddress and c2v_reprofile both simply just create a new MDO and store it. There's no guarantee that a reading thread will see the writes that defined the layout promptly so it could see garbage instead of the proper cell layout.
We seen crashes that we suspect are caused by this such as:
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (ciMethodData.cpp:333), pid=8820, tid=8835
# Error: ShouldNotReachHere()
#
# JRE version: Java(TM) SE Runtime Environment Oracle GraalVM 21-dev+35.1 (21.0+35) (build 21+35-jvmci-23.1-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21-dev+35.1 (21+35-jvmci-23.1-b13, mixed mode, sharing, tiered, jvmci, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x5bbb60] ciMethodData::data_from(DataLayout*)+0x290
#
Current CompileTask:
C1: 12684 14575 3 jdk.incubator.vector.Int128Vector::vec (8 bytes)Stack: [0x00007fd472363000,0x00007fd472464000], sp=0x00007fd472461ea0, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x5bbb60] ciMethodData::data_from(DataLayout*)+0x290 (ciMethodData.cpp:333)
V [libjvm.so+0x5bc0a8] ciMethodData::load_data()+0x538
V [libjvm.so+0x5b9948] ciMethod::ensure_method_data()+0x168
V [libjvm.so+0x4c422b] Compilation::compile_java_method()+0x3b
V [libjvm.so+0x4c4732] Compilation::compile_method()+0x112
V [libjvm.so+0x4c4ae9] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, bool, DirectiveSet*)+0x1f9
V [libjvm.so+0x4c5981] Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0xb1
V [libjvm.so+0x64b8a7] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa97
V [libjvm.so+0x64e988] CompileBroker::compiler_thread_loop()+0x698
V [libjvm.so+0x8f3728] JavaThread::thread_main_inner() [clone .part.0]+0xb8
V [libjvm.so+0xe97f58] Thread::call_run()+0xa8
V [libjvm.so+0xcbe2da] thread_native_entry(Thread*)+0xda
We seen crashes that we suspect are caused by this such as:
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (ciMethodData.cpp:333), pid=8820, tid=8835
# Error: ShouldNotReachHere()
#
# JRE version: Java(TM) SE Runtime Environment Oracle GraalVM 21-dev+35.1 (21.0+35) (build 21+35-jvmci-23.1-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21-dev+35.1 (21+35-jvmci-23.1-b13, mixed mode, sharing, tiered, jvmci, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x5bbb60] ciMethodData::data_from(DataLayout*)+0x290
#
Current CompileTask:
C1: 12684 14575 3 jdk.incubator.vector.Int128Vector::vec (8 bytes)Stack: [0x00007fd472363000,0x00007fd472464000], sp=0x00007fd472461ea0, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x5bbb60] ciMethodData::data_from(DataLayout*)+0x290 (ciMethodData.cpp:333)
V [libjvm.so+0x5bc0a8] ciMethodData::load_data()+0x538
V [libjvm.so+0x5b9948] ciMethod::ensure_method_data()+0x168
V [libjvm.so+0x4c422b] Compilation::compile_java_method()+0x3b
V [libjvm.so+0x4c4732] Compilation::compile_method()+0x112
V [libjvm.so+0x4c4ae9] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, bool, DirectiveSet*)+0x1f9
V [libjvm.so+0x4c5981] Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0xb1
V [libjvm.so+0x64b8a7] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa97
V [libjvm.so+0x64e988] CompileBroker::compiler_thread_loop()+0x698
V [libjvm.so+0x8f3728] JavaThread::thread_main_inner() [clone .part.0]+0xb8
V [libjvm.so+0xe97f58] Thread::call_run()+0xa8
V [libjvm.so+0xcbe2da] thread_native_entry(Thread*)+0xda
Attachments
Issue Links
- links to
-
Commit openjdk/jdk/a07a4a3a
-
Review(master) openjdk/jdk/16026