Move to interpreter if async-exceptions are pending.
It was previously possible to miss async exceptions due to a
concurrent exception occurring that allows the thread to enter JITed
code without checking for async-exceptions. Once this happens it is
possible the thread will never re-enter interpreted code where the
exception can be noticed.
Test: ./test.py --host
Test: stress --cpu 60
Bug: 67576489
Change-Id: Ic93490d4b3e945ac92ab9e8c865e07ae76ca213a
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 8999e17..0cc2622 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2866,6 +2866,11 @@
return true;
}
+ if (Thread::Current()->IsAsyncExceptionPending()) {
+ // Force use of interpreter to handle async-exceptions
+ return true;
+ }
+
if (runtime->IsJavaDebuggable()) {
// For simplicity, we ignore precompiled code and go to the interpreter
// assuming we don't already have jitted code.