RFR: 7903526: jtreg should handle all exceptions [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue Oct 31 20:47:04 UTC 2023
On Sat, 28 Oct 2023 16:42:52 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added sync ofr globalUncaughtThrowable.
>
> src/share/classes/com/sun/javatest/regtest/agent/MainActionHelper.java line 264:
>
>> 262: && (error == null)) {
>> 263: if (avmr.t == null) {
>> 264: error = tg.uncaughtThrowable != null ? tg.uncaughtThrowable : globalUncaughtThrowable;
>
> Are you missing synchronisation here? The VM-side UHE is set while holding the lock for the MainActionHelper instance whereas help you read without any synchronisation. If you make globalUncaughtThrowable volatile then it would be okay, meaning keep the synchronisation in the setter code, read from elsewhere without synchronisation.
Thanks, added volatile.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/172#discussion_r1378107256
More information about the jtreg-dev
mailing list