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

David Holmes david.holmes at oracle.com
Wed Sep 18 22:26:45 PDT 2013


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