From a4cdd36ba332b63ccaae8416f68d3ac98d7dd68f Mon Sep 17 00:00:00 2001 From: Alex Light Date: Thu, 18 Apr 2019 09:17:10 -0700 Subject: Prevent concurrent GC stack-walks during deoptimization We could end up modifying the instrumentation stack at the same time the GC or thread-flip stack walks are occurring. This could cause crashes or check-failures as the stack is in an inconsistent state. To fix this we changed the deoptimization process to block GC stack walks. We also standardized openjdkjvmti.so deoptimization to use a single entrypoint. Bug: 72608560 Test: ./test.py --host Test: ./tools/parallel_run.py Change-Id: I942ff891930d22a579345265897916cf84842a1c --- openjdkjvmti/ti_thread.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openjdkjvmti/ti_thread.cc') diff --git a/openjdkjvmti/ti_thread.cc b/openjdkjvmti/ti_thread.cc index 15fdfb3ab5..6c50a2039c 100644 --- a/openjdkjvmti/ti_thread.cc +++ b/openjdkjvmti/ti_thread.cc @@ -37,6 +37,7 @@ #include "art_field-inl.h" #include "art_jvmti.h" #include "base/mutex.h" +#include "deopt_manager.h" #include "events-inl.h" #include "gc/system_weak.h" #include "gc/collector_type.h" @@ -1101,7 +1102,7 @@ jvmtiError ThreadUtil::StopThread(jvmtiEnv* env ATTRIBUTE_UNUSED, void Run(art::Thread* me) override REQUIRES_SHARED(art::Locks::mutator_lock_) { // Make sure the thread is prepared to notice the exception. - art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(me); + DeoptManager::Get()->DeoptimizeThread(me); me->SetAsyncException(exception_.Get()); // Wake up the thread if it is sleeping. me->Notify(); -- cgit v1.2.3-59-g8ed1b