-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8308151: [JVMCI] capture JVMCI exceptions in hs-err #14000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back dnsimon! A progress list of the required criteria for merging this PR into |
| JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci, | ||
| (jlong) compile_state, compile_state->task()->compile_id()); | ||
| #ifdef ASSERT | ||
| if (JVMCIENV->has_pending_exception() && JVMCICompileMethodExceptionIsFatal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame to introduce a VM flag (i.e., JVMCICompileMethodExceptionIsFatal) for a test case but I don't know of any other way to do this. As far as I know, system properties cannot be accessed here. Maybe using an environment variable is better than a VM flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't you use a JVMCI property for this? You get a chance to see them when copying them to Graal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copying is only done when using libgraal. I'd like to have this test run in a JDK without libgraal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that I can simply use system properties after all: 90f4346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that looks good.
Webrevs
|
src/hotspot/share/jvmci/jvmciEnv.cpp
Outdated
| line++; | ||
| } | ||
| if (line >= max_lines) { | ||
| JVMCI_event_1("[elided %d more stack trace lines]", line - max_lines); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add this output to the last line instead of burning an extra line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed:
Event: 0.237 Thread 0x000000011e019e10 compiler.jvmci.TestUncaughtErrorInCompileMethod$CompilerCreationError
Event: 0.237 Thread 0x000000011e019e10 at compiler.jvmci.TestUncaughtErrorInCompileMethod$1.createCompiler(TestUncaughtErrorInCompileMethod.java:161) [elided 2 more stack trace lines]
| JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci, | ||
| (jlong) compile_state, compile_state->task()->compile_id()); | ||
| #ifdef ASSERT | ||
| if (JVMCIENV->has_pending_exception() && JVMCICompileMethodExceptionIsFatal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't you use a JVMCI property for this? You get a chance to see them when copying them to Graal.
…mpileMethodExceptionIsFatal system property
| JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci, | ||
| (jlong) compile_state, compile_state->task()->compile_id()); | ||
| if (JVMCIENV->has_pending_exception()) { | ||
| const char* val = Arguments::PropertyList_get_value(Arguments::system_properties(), "test.jvmci.compileMethodExceptionIsFatal"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this view on system properties is restricted to properties set at VM startup (e.g. on the command line) and will not see the result of calls to System.setProperty() made by an application.
|
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout JDK-8308151
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@dougxc this pull request can not be integrated into git checkout JDK-8308151
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@dougxc This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 14 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@dougxc Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
The latest version looks ok to me. |
|
Thanks Tom for the reviews. /integrate |
|
Going to push as commit 05c095c.
Your commit was automatically rebased without conflicts. |
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):
It is also be used to enhance the
-XX:+PrintCompilationmessage issued for a failed compilation:[1] https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#exceptiondescribe
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14000/head:pull/14000$ git checkout pull/14000Update a local copy of the PR:
$ git checkout pull/14000$ git pull https://git.openjdk.org/jdk.git pull/14000/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14000View PR using the GUI difftool:
$ git pr show -t 14000Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14000.diff
Webrev
Link to Webrev Comment