RFR: JDK-8318444: Write details about compilation bailouts into crash reports [v3]

Tobias Hartmann thartmann at openjdk.org
Mon Oct 30 12:34:34 UTC 2023


On Thu, 26 Oct 2023 16:16:49 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> A little debugging aid to help analyze broken bailout chains, mainly in C2 (C1 is pretty clean).
>> 
>> A broken bailout chain occurs when code marks a compilation as failed, but then either that function itself or any of its caller functions fails to abort the compilation. That may cause crashes, e.g. [JDK-8318183](https://bugs.openjdk.org/browse/JDK-8318183) or [JDK-8318445](https://bugs.openjdk.org/browse/JDK-8318445).
>> 
>> Now, if the compiler initiates a bailout, it stores some context information - compile id, time, and call stack. That information is stored as part of `Compile` or `Compilation`, depending on the compiler.
>> 
>> If we crash later during the same compilation, we print out that information as part of the crash report. That way, we have two call stacks, and it is easy to spot where the compiler failed to heed the bailout.
>> 
>> ---------
>> 
>> Looks like this (from https://github.com/openjdk/jdk/pull/16248). The first call stack is the crash point. The second call stack is the point where the compiler bailout was initiated. 
>> 
>> 
>> Current CompileTask:
>> C2:2574 45 45  843       4       sun.nio.fs.UnixPath::resolve (17 bytes)
>> 
>> Stack: [0x00007fa608cb3000,0x00007fa608db4000],  sp=0x00007fa608daf310,  free space=1008k
>> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
>> V  [libjvm.so+0x631bb4]  Unique_Node_List::push(Node*)+0x20  (node.hpp:1650)
>> V  [libjvm.so+0xb8ea65]  ConnectionGraph::verify_ram_nodes(Compile*, Node*)+0x87  (escape.cpp:743)
>> V  [libjvm.so+0x960dda]  Compile::Optimize()+0x956  (compile.cpp:2361)
>> V  [libjvm.so+0x959d6c]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x165e  (compile.cpp:860)
>> V  [libjvm.so+0x81bcd9]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x203  (c2compiler.cpp:134)
>> V  [libjvm.so+0x97bf63]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xac5  (compileBroker.cpp:2290)
>> V  [libjvm.so+0x97a981]  CompileBroker::compiler_thread_loop()+0x411  (compileBroker.cpp:1951)
>> V  [libjvm.so+0x99ebc0]  CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x84  (compilerThread.cpp:61)
>> V  [libjvm.so+0xde0050]  JavaThread::thread_main_inner()+0x15c  (javaThread.cpp:720)
>> V  [libjvm.so+0xddfeea]  JavaThread::run()+0x258  (javaThread.cpp:705)
>> V  [libjvm.so+0x15f5a04]  Thread::call_run()+0x1a8  (thread.cpp:220)
>> V  [libjvm.so+0x12de0a2]  thread_native_entry(Thread*)+0x1c3  (os_linux.cpp:785)
>> 
>> siginfo: si_signo: 11...
>
> Thomas Stuefe has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update src/hotspot/share/compiler/compilationFailureInfo.hpp
>    
>    Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>  - Update src/hotspot/share/utilities/vmError.cpp
>    
>    Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>

All tests passed.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16247#issuecomment-1785087277


More information about the hotspot-runtime-dev mailing list