RFR: 8272096: Exceptions::new_exception can return wrong exception [v2]
David Holmes
dholmes at openjdk.org
Fri Jul 15 12:53:04 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.
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.
src/hotspot/share/utilities/exceptions.cpp line 360:
> 358: incoming_exception = Handle(thread, thread->pending_exception());
> 359: thread->clear_pending_exception();
> 360: incoming_exception->print();
We shouldn't be unconditionally printing in product mode. If we have an unexpected pending exception then that is a bug in the VM code. The end user won't have a clue what is being printed or why, nor what to do about it.
src/hotspot/share/utilities/exceptions.cpp line 361:
> 359: thread->clear_pending_exception();
> 360: incoming_exception->print();
> 361: ResourceMark rm;
rm(thread);
-------------
PR: https://git.openjdk.org/jdk/pull/9492
More information about the hotspot-dev
mailing list