-
Notifications
You must be signed in to change notification settings - Fork 76
8259275: JRuby crashes while resolving invokedynamic instruction #104
Conversation
|
/label remove hotspot |
|
👋 Welcome back ccheung! A progress list of the required criteria for merging this PR into |
|
@calvinccheung The |
|
@calvinccheung |
Webrevs
|
| } | ||
| oop exception = THREAD->pending_exception(); | ||
| if (exception->is_a(SystemDictionary::Error_klass())) { | ||
| CLEAR_PENDING_EXCEPTION; |
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.
Just for my clarification, why do you clear the pending exception in the case of Error_klass()? Please consider adding a comment explaining this.
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.
Hi Lois,
Thanks for your review. I've added some comment in ClassListParser::resolve_indy for the Error_klass case.
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 would have expected only LinkageErrors to be ignored as they are the only "expected" errors aren't they?
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.
LinkageError should work since BootstrapMethodError, NoSuchMethodError, etc. are subclasses.
I've changed the check to:
if (exception->is_a(SystemDictionary::LinkageError_klass())) {
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.
After offline discussion with Ioi, we've decided to use log_warning(cds) to output the exception message since log_warning does not require setting a log level. Also, the exit(1) is not needed, we can continue with the CDS dumping after printing the message and clearing the exception.
iklam
left a comment
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.
|
@calvinccheung 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 10 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
yminqi
left a comment
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!
| ClassListParser::resolve_indy_impl(class_name_symbol, THREAD); | ||
| if (HAS_PENDING_EXCEPTION) { | ||
| ResourceMark rm(THREAD); | ||
| tty->print("resolve_indy for class %s has", class_name_symbol->as_C_string()); |
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.
Shouldn't this be using appropriate unified logging?
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.
Ok. I've changed it to LogTarget(Debug, cds, lambda).
dholmes-ora
left a comment
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 missed the fact some of this code was just being moved around when I took the first look, so my comments could be seen as something suitable for a follow up RFE.
This is not a full review.
Thanks,
David
| // or NoSuchMethodError so that CDS dumping can continue. | ||
| CLEAR_PENDING_EXCEPTION; | ||
| } else { | ||
| exit(1); |
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.
We should never just use exit() - at a minimum vm_exit(). But we should not silently exit with no indication of what went wrong. I'm not sure of the call chain here but can't we just return and let higher layers do the same until we eventually hit a cleaner exit path that reports the exception?
Edit: I see now that this code was moved from another location not introduced with this fix, but this still seems wrong to me.
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.
For now, I think the logging in ClassListParser::resolve_indy should just by tty->print instead of using UL. This way, if the exit(1) is hit, there will be some information about the reason. Also, not too many users would enable -Xlog:cds+lambda=debug.
lfoltan
left a comment
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, thank you for adding the comment!
Lois
1. use log_warning(cds) to output the exception message; 2. no need to exit on exception.
|
/reviewer credit dholmes |
|
@calvinccheung Reviewer |
|
/integrate |
|
@calvinccheung Since your change was applied there have been 11 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 15dd8f3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this proposed change which fixes 2 problems during CDS dump time:
ClassListParser::resolve_indy(), exception could be thrown frombootstrap_specifier.resolve_bsm()but was not handled;ConstantPool::remove_unshareable_info(), tag was not setup correctly on error conditions.Passed tiers 1 - 4 testing.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk16 pull/104/head:pull/104$ git checkout pull/104