On Wed, 29 Mar 2023 21:55:35 GMT, Daniel D. Daugherty <[email protected]>
wrote:
>> Roman Kennke has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Process lock-stack oops before inspecting them, when in foreign thread and
>> not at safepoint. Add verifications.
>
> src/hotspot/share/runtime/threads.cpp line 1423:
>
>> 1421:
>> 1422: JavaThread* Threads::owning_thread_from_object(ThreadsList * t_list,
>> oop obj) {
>> 1423: assert(SafepointSynchronize::is_at_safepoint(), "not safe outside of
>> safepoint");
>
> `ObjectSynchronizer::get_lock_owner()` calls
> `Threads::owning_thread_from_object()`
> and I don't think you can assert that `ObjectSynchronizer::get_lock_owner()`
> is only
> called from a safepoint. In particular, `ThreadSnapshot::initialize()` calls
> `ObjectSynchronizer::get_lock_owner()` and I believe that `initialize()`
> function can
> be called from non-safepoint places with M&M APIs...
Update: In v35 you put back the `!UseFastLocking` check in `jmm_GetThreadInfo()`
so now the `assert()` won't fire, but you've again changed the behavior of that
API
and now it will be able to observe fewer thread state changes than it did
before.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1152526559