RFR: 8314225: SIGSEGV in JavaThread::is_lock_owned [v2]
David Holmes
dholmes at openjdk.org
Wed May 1 10:05:03 UTC 2024
On Wed, 1 May 2024 09:49:06 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> src/hotspot/share/runtime/vframeArray.cpp line 100:
>>
>>> 98:
>>> 99: assert(current_thread->is_Java_thread(), "Must be a JavaThread");
>>> 100: assert(ObjectSynchronizer::current_thread_holds_lock((JavaThread*) current_thread, Handle(current_thread, dest->obj())),
>>
>> This makes me wonder about the assert at line 96 that allows monitor->owner() == nullptr. If that can happen due to OOM, then we need to check for that here too.
>
> Nit: don't use C-style casts use `JavaThread::cast(thread_current)` (though this won't be necessary once you change the type of `current_thread`.
We need a RFE to rename `MonitorInfo::_owner` to be `MonitorInfo::_obj` - the current terminology is very confusing!
But yes we need to check `dest->obj()` for null here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18940#discussion_r1586112864
More information about the hotspot-dev
mailing list