On Fri, 5 May 2023 14:40:52 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Relax zapped-entry test when calling thread is not owning thread
>
> src/hotspot/share/runtime/lockStack.cpp line 70:
> 
>> 68:     assert(_base[i] != nullptr || !is_owning_thread(), "no zapped before 
>> top");
>> 69:     for (int j = i + 1; j < top; j++) {
>> 70:       assert(_base[i] != _base[j], "entries must be unique: %s", msg);
> 
> Okay so you tweaked the assert to allow a `nullptr` value when the caller
> is not the owning thread. Got it.
> 
> Is it possible for `_base[i]` and `_base[j]` to both be `nullptr` when the
> caller is not the owning thread? If so, then that assert will also fire...

Aww right. The whole block is not safe to verify when not called from the 
owning thread, because the owning thread may modify everything under our feet. 
I've changed it so that the whole loops are only done when called from owning 
thread.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1186187814

Reply via email to