RFR: JDK-8318444: Write details about compilation bailouts into crash reports [v2]
Thomas Stuefe
stuefe at openjdk.org
Fri Oct 20 07:13:22 UTC 2023
> 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 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x000000000000002...
Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
reinstate elapsed time prefix in hs-err file
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16247/files
- new: https://git.openjdk.org/jdk/pull/16247/files/13f168bf..e9d6830b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16247&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16247&range=00-01
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/16247.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16247/head:pull/16247
PR: https://git.openjdk.org/jdk/pull/16247
More information about the hotspot-compiler-dev
mailing list