RFR: 8272096: Exceptions::new_exception can return wrong exception [v2]

Coleen Phillimore coleenp at openjdk.org
Fri Jul 15 14:37:06 UTC 2022


On Fri, 15 Jul 2022 12:38:31 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.
>
> 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.

Yes, I agree. I was going to add it under -Xlog:exceptions but if  you turn on -Xlog:exceptions, you can see where the pending exception comes from so that's not helpful. I removed it.

> src/hotspot/share/utilities/exceptions.cpp line 361:
> 
>> 359:       thread->clear_pending_exception();
>> 360:       incoming_exception->print();
>> 361:       ResourceMark rm;
> 
> rm(thread);

ok

-------------

PR: https://git.openjdk.org/jdk/pull/9492


More information about the hotspot-dev mailing list