RFR: 8272096: Exceptions::new_exception can return wrong exception [v2]
Coleen Phillimore
coleenp at openjdk.org
Fri Jul 15 14:41:17 UTC 2022
On Thu, 14 Jul 2022 15:06:49 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> 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.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> second get_user_name_slow call should CHECK_NULL too.
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.
The CR complains of throwing the exception that you get while constructing an exception and that was confusing, but it's the right thing to do. If you get an OOM or StackOverflow creating an exception, you want the OOM or StackOverflow to be returned. See CR for more discussion.
-------------
PR: https://git.openjdk.org/jdk/pull/9492
More information about the hotspot-dev
mailing list