RFR: 8314225: SIGSEGV in JavaThread::is_lock_owned [v6]

Dean Long dlong at openjdk.org
Fri May 3 02:04:59 UTC 2024


On Thu, 2 May 2024 19:40:18 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> Removal of JavaThread's MonitorChunks member.  This held lock information during deoptimization, but access to it is unnecessary for anything other than the deoptimization itself.
>> 
>> Access to it in is_lock_owned() was racy, and caused rare crashes.
>
> Kevin Walls has updated the pull request incrementally with one additional commit since the last revision:
> 
>   monitor->owner() == nullptr handling in fill_in

src/hotspot/share/runtime/synchronizer.cpp line 1060:

> 1058:       // the ObjectMonitor.
> 1059:     } else if (LockingMode == LM_LEGACY && mark.has_locker()
> 1060:                && JavaThread::cast(current)->is_lock_owned((address)mark.locker())) {

This looks risky.  How about guarding it with a check for current->is_Java_thread()?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18940#discussion_r1588602588


More information about the hotspot-dev mailing list