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
diff --git a/openjdkjvmti/deopt_manager.h b/openjdkjvmti/deopt_manager.h
index 73a64be..9789c5e 100644
--- a/openjdkjvmti/deopt_manager.h
+++ b/openjdkjvmti/deopt_manager.h
@@ -112,7 +112,9 @@
REQUIRES(!deoptimization_status_lock_, !art::Roles::uninterruptible_)
REQUIRES_SHARED(art::Locks::mutator_lock_);
- void DeoptimizeThread(art::Thread* target) REQUIRES_SHARED(art::Locks::mutator_lock_);
+ void DeoptimizeThread(art::Thread* target)
+ REQUIRES(!art::Locks::thread_list_lock_)
+ REQUIRES_SHARED(art::Locks::mutator_lock_);
void DeoptimizeAllThreads() REQUIRES_SHARED(art::Locks::mutator_lock_);
void FinishSetup()