-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8272096: Exceptions::new_exception can return wrong exception #9492
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
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.
The changes look good!
Thanks, Harold
@coleenp 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 65 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 |
Thanks Harold! |
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 Coleen,
I'm really not sure this is actually addressing the issues/concerns that were raised in the bug report. The assertion is good but otherwise nothing has changed has it?
Every place you changed a THREAD to a CHECK you've changed the existing behaviour of the code. That existing behaviour is dubious because of the missing CHECK but nevertheless it has now been changed, and it isn't always easily discernible exactly how that change will manifest in higher-level code. (It is somewhat disappointing to see so many remaining places that the THREADS/TRAPS cleanup missed :( ).
I think I need to study this one further.
Thanks.
By changing THREAD to CHECK, I technically didn't change the behavior of the code because the code for new_exception would have thrown the pending exception if it didn't get an OOM allocating the new exception. For the get_u1, get_u2 case, the stream is truncated so the code wasn't going to get much further anyway. |
You have changed behaviour - even if things are actually more correct. For example given:
If the |
I actually haven't changed the behavior because instead of "bad class index" in the case of truncation, and the old behavior would throw the truncation exception. |
Ah now I see sorry. new_exception would have ignored the requested exception and thrown the pending truncation exception instead. Now it is much more clear that, that is what happens. |
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.
Thumbs up from me now - sorry it took me a while to "get it".
Thanks.
Thanks David for the review and for battling the confusion this code provoked. Hopefully in the end this helps. |
Going to push as commit bbc5748.
Your commit was automatically rebased without conflicts. |
I added an assert if Exceptions::new_exception is called with a pending exception and fixed the places where it is called with a pending exception. That leaves only two possible exceptions. I left the product mode code in to return the pending exception if allocating the exception message doesn't thrown OOM because it was always there and seems dubious. Tested with jck tests and tier1-7.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9492/head:pull/9492
$ git checkout pull/9492
Update a local copy of the PR:
$ git checkout pull/9492
$ git pull https://git.openjdk.org/jdk pull/9492/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9492
View PR using the GUI difftool:
$ git pr show -t 9492
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9492.diff