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

Kevin Walls kevinw at openjdk.org
Wed May 1 10:05:03 UTC 2024


On Wed, 1 May 2024 09:56:59 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.

OK yes - if monitor->owner() == nullptr
that's the MonitorInfo* we got from vframe->monitors() has a null Handle _owner

current_thread_holds_lock() is going to call read_stable_mark() on the oop, and likely crash, so this is a really good point!

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

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


More information about the hotspot-dev mailing list