RFR: 8308151: [JVMCI] capture JVMCI exceptions in hs-err [v6]
Doug Simon
dnsimon at openjdk.org
Tue May 23 15:39:44 UTC 2023
> When there is a pending exception after a JVMCI upcall into libjvmci, the VM calls the ExceptionDescribe JNI function to print the exception. Unfortunately, this output goes to "a system error-reporting channel" [1] which may not be tty. It also means the output is not in a hs-err log should the VM then exit with a fatal error. This has historically made it harder to triage libgraal bugs (i.e. the console output is usually required in addition to the hs-err crash log).
>
> This PR addresses these shortcomings by printing the exception info to a string which is added to the JVMCI event log (for hs-err):
>
> JVMCI Events (11 events):
> ...
> Event: 0.274 Thread 0x0000000146819210 compiler.jvmci.TestUncaughtErrorInCompileMethod$CompilerCreationError
> Event: 0.274 Thread 0x0000000146819210 at compiler.jvmci.TestUncaughtErrorInCompileMethod$1.createCompiler(TestUncaughtErrorInCompileMethod.java:147)
> Event: 0.274 Thread 0x0000000146819210 at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.getCompiler(HotSpotJVMCIRuntime.java:829)
> Event: 0.274 Thread 0x0000000146819210 at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(HotSpotJVMCIRuntime.java:943)
>
>
> It is also be used to enhance the `-XX:+PrintCompilation` message issued for a failed compilation:
>
> COMPILE SKIPPED: uncaught exception in call_HotSpotJVMCIRuntime_compileMethod [compiler.jvmci.TestUncaughtErrorInCompileMethod$CompilerCreationError]
>
>
> [1] https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#exceptiondescribe
Doug Simon has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
[skip ci] make TestUncaughtErrorInCompileMethod more robust
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14000/files
- new: https://git.openjdk.org/jdk/pull/14000/files/fe2ca698..0471e7c0
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14000&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14000&range=04-05
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/14000.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14000/head:pull/14000
PR: https://git.openjdk.org/jdk/pull/14000
More information about the hotspot-compiler-dev
mailing list