diff options
author | 2019-04-18 09:17:10 -0700 | |
---|---|---|
committer | 2019-04-23 18:15:06 +0000 | |
commit | a4cdd36ba332b63ccaae8416f68d3ac98d7dd68f (patch) | |
tree | 7224dda71c3fd35959b0f968f5478af4f92a145d /openjdkjvmti/ti_thread.cc | |
parent | 4160c12d4e93dd7a9da68a82f63cff4c23fb5c17 (diff) |
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
Diffstat (limited to 'openjdkjvmti/ti_thread.cc')
-rw-r--r-- | openjdkjvmti/ti_thread.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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(); |