RFR: 8357184: Test vmTestbase/nsk/jdi/ExceptionEvent/_itself_/exevent008/TestDescription.java fails with unreported exception

Alex Menkov amenkov at openjdk.org
Thu May 29 21:41:51 UTC 2025


On Thu, 29 May 2025 21:18:03 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> Since there is only one writer thread, volatile should be sufficient. The only requirement is to make writes visible to the reader thread. volatile accomplishes that.
>
> Thanks for explanation. Can you please add corresponding comment. The volatile counters are rare thing...

I think the evaluation is not correct (lack of synchronization is an issue too).
main thread also writes the value and I think this is the problem here.
Look at line 148 - it resets `counter1` instead of `counter2` and this happens after the test sends `COMMAND_TEST1`. So if listener thread already handled caught exception, we get the failure.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25236#discussion_r2114790682


More information about the serviceability-dev mailing list