RFR: 8253033: CheckUnhandledOops check fails in ThreadSnapshot::initialize… [v2]

David Holmes dholmes at openjdk.java.net
Fri Sep 11 23:03:12 UTC 2020


On Fri, 11 Sep 2020 18:26:03 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This is a specific of "CheckUnhandledOops"
>> I've written in bug comment "Another possible fix would be to disable corruption of NULL unhandled oops. They couldn't
>> be changed really."
>> We discussed it with Coleen and seems that moving NULL oops out of possible safepoint or handling them seems easier
>> option than changing UnhandledOops.cpp to don't corrupt NULL. It is here:
>> https://github.com/openjdk/jdk/blob/77bdc3065057b07a676b010562c89bb0f21512b7/src/hotspot/share/runtime/unhandledOops.cpp#L113
>
> ThreadService::get_current_contended_monitor calls Thread::check_for_dangling_thread_pointer calls
> ThreadsSMRSupport::is_a_protected_JavaThread_with_lock((JavaThread *) thread),
> The potential safepoint is here, where CheckUnhandledOops puts junk in any oop on the stack.
> 
> inline bool ThreadsSMRSupport::is_a_protected_JavaThread_with_lock(JavaThread *thread) {
>   MutexLocker ml(Threads_lock->owned_by_self() ? NULL : Threads_lock);
>   return is_a_protected_JavaThread(thread);
> }

Thanks Coleen. I'm still not sure that CheckUnhandledOops should be touching NULL oops but ...

Leonid the workaround seems okay.

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

PR: https://git.openjdk.java.net/jdk/pull/123


More information about the serviceability-dev mailing list