Convert warning: "Thread holding lock at safepoint that vm can block on: ..." into assertion?

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Sep 19 06:25:15 PDT 2013


David,

There's no other thread here - before entering safepoint it checks that 
the thread doesn't hold any locks VM can block on.

Best regards,
Vladimir Ivanov

On 9/19/13 9:26 AM, David Holmes wrote:
> Hi Vladimir,
>
> On 17/09/2013 11:01 PM, Vladimir Ivanov wrote:
>> Hi,
>>
>> I don't see much value in having the following warning in
>> Thread::check_for_valid_safepoint_state:
>> src/share/vm/runtime/thread.cpp:
>>     933           warning("Thread holding lock at safepoint that vm can
>> block on: %s", cur->name());
>>
>> It's very easy to miss such warnings during testing, but they may
>> manifest real problems which are hard to trigger/diagnose in the field.
>>
>> What do people think about converting corresponding check into
>> assertion? It is already present only in non-product builds.
>
> That isn't unreasonable. Though I note that it won't help you see where
> the problematic lock was acquired as you will see the stack of the
> calling thread not the thread holding the lock.
>
> David
>
>> Best regards,
>> Vladimir Ivanov


More information about the hotspot-runtime-dev mailing list