RFR: 8373944: ObjectMonitor::ExitOnSuspend can call java_lang_VirtualThread::set_onWaitingList() while in safepoint
Patricio Chilano Mateo
pchilanomate at openjdk.org
Mon Feb 23 16:00:45 UTC 2026
On Fri, 20 Feb 2026 02:29:42 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Please review the following patch. `ExitOnSuspend::operator()` may run while a safepoint is in progress, which can lead to crashes because releasing the monitor involves touching oops if the successor is a virtual thread. The proposed fix is to process pending operations before releasing the monitor.
>> I added a new test that reliably reproduces the issue with the extra `assert_not_at_safepoint()` added in this patch, and verified the issue is now fixed.
>>
>> Thanks,
>> Patricio
>
> Fix looks good. Thanks
>
> Nice test! Five Phasers plus a CountDownLatch - wow!
Thanks for the reviews @dholmes-ora and @fbredber!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29822#issuecomment-3945663943
More information about the serviceability-dev
mailing list