RFR: 8253833: mutexLocker assert_locked_or_safepoint should not access VMThread state from non-VM-thread
Coleen Phillimore
coleenp at openjdk.java.net
Thu Oct 8 14:54:48 UTC 2020
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.
----------------------------------------------------------------------
On Thu, 8 Oct 2020 14:51:16 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> It's unsafe for all threads except VM thread to access the current vm operation.
>> This part of the assert is also faulty:
>> If we are not at safepoint and the operation requester (calling thread) would be the owner of the lock do not mean it
>> is safe for current thread.
>> Passes t1-5. (also note VMThread::vm_operation() assert current thread is VM thread, and I have seen no such assert)
>>
>> Thanks
>
> src/hotspot/share/runtime/mutexLocker.cpp line 173:
>
>> 171: if (!Universe::is_fully_initialized()) return;
>> 172: fatal("must own lock %s", lock->name());
>> 173: }
>
> You could refactor this like:
> assert_locked_or_safepoint(lock) {
> if (lock->owned_by_self()) return;
> assert_locked_or_safepoint_weak(lock);
> }
Nah, never mind. It's a short function.
-------------
PR: https://git.openjdk.java.net/jdk/pull/563
More information about the hotspot-runtime-dev
mailing list