-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8344013: "bad tag in log" assert with +LogCompilation +CITimeVerbose #22331
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 szaldana! A progress list of the required criteria for merging this PR into |
@SoniaZaldana 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 59 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 |
@SoniaZaldana The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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.
Looks good to me. Can you also add a regression test for it? Since this already triggers with --version
, you can just create a hello world like test and run with the mentioned flags.
Just a side note:
Note how the constructor adds the phase tag.
You can directly insert the permalink (in the non-blame view) such that the code is inlined in the PR for easier reading :-)
jdk/src/hotspot/share/opto/compile.cpp
Line 4327 in 6f622da
_log->begin_head("phase name='%s' nodes='%d' live='%d'", phase_name(), _compile->unique(), _compile->live_nodes()); |
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.
Looks good to me (C1 seems to already have this check). Thanks for fixing this.
Thanks for the reviews @chhagedorn @dafedafe! I added a regression test. |
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.
Thanks for adding the test! Two minor comments, otherwise, looks good.
* @bug 8344013 | ||
* @requires vm.debug == true & vm.compiler2.enabled | ||
* @summary Verify the xmlStream log stack is not left in a bad state | ||
* @library /test/lib / |
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.
Not required and can be removed.
* @library /test/lib / |
* @requires vm.debug == true & vm.compiler2.enabled | ||
* @summary Verify the xmlStream log stack is not left in a bad state | ||
* @library /test/lib / | ||
* @run main/othervm -XX:+LogCompilation -XX:CompileCommand=log,*.* -XX:+CITimeVerbose -Xcomp -Xbatch compiler.debug.TestLogStackAssert |
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.
-Xbatch
is implied by -Xcomp
.
* @run main/othervm -XX:+LogCompilation -XX:CompileCommand=log,*.* -XX:+CITimeVerbose -Xcomp -Xbatch compiler.debug.TestLogStackAssert | |
* @run main/othervm -XX:+LogCompilation -XX:CompileCommand=log,*.* -XX:+CITimeVerbose -Xcomp compiler.debug.TestLogStackAssert |
/integrate |
Going to push as commit 3689f39.
Your commit was automatically rebased without conflicts. |
@SoniaZaldana Pushed as commit 3689f39. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Very good. Thank you for fixing. |
Hi folks,
This PR addresses 8344013.
Sometimes the writing to xmlStream is mixed from several threads, and therefore the xmlStream tag stack can end up in a bad state. When this occurs, the VM crashes in
xmlStream::pop_tag
withassert(false) failed: bad tag in log
.In this case, running
java -XX:+LogCompilation -XX:CompileCommand="log,*.*" -XX:+CITimeVerbose -Xcomp -Xbatch -version
,xmlStream::pop_tag
is expecting to pop the tagtask
but findsphase
instead.I found the issue stems from 8330157. The problematic code is in the destructor for TracePhase.
Note how the constructor adds the phase tag.
However, in the destructor, if we return early, we don’t pop that tag, leading to the xmlStream tag stack to end up in a bad state. With this patch, I made sure we pop the tag even if we return early.
Cheers,
Sonia
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22331/head:pull/22331
$ git checkout pull/22331
Update a local copy of the PR:
$ git checkout pull/22331
$ git pull https://git.openjdk.org/jdk.git pull/22331/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22331
View PR using the GUI difftool:
$ git pr show -t 22331
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22331.diff
Using Webrev
Link to Webrev Comment