On Fri, 11 Sep 2020 03:37:55 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:
>> I'm missing something. How can a NULL oop get corrupted even if there is a >> GC? > > 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); } ------------- PR: https://git.openjdk.java.net/jdk/pull/123