From fac21782ed87ce800813cfa0f9b4ee4bb4aac462 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 13 Mar 2018 17:01:09 +0000 Subject: Fix delivering async exception while in compiled code. Change artInstrumentationMethodExitFromCode() to check for async exceptions. Also fix kDebugExceptionDelivery = true causing stale ObjPtr<> use. Test: run-test --jit -runtime-option -Xjitthreshold:0 \ 1934-jvmti-signal-thread Test: Repeat with kDebugExceptionDelivery = true. Bug: 74583459 Change-Id: Ia2e777cc3ccef4eba549aa290f8bc12608eafe44 --- runtime/quick_exception_handler.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/quick_exception_handler.cc') diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 006405f095..077aa33925 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -143,14 +143,14 @@ class CatchBlockStackVisitor FINAL : public StackVisitor { void QuickExceptionHandler::FindCatch(ObjPtr exception) { DCHECK(!is_deoptimization_); + StackHandleScope<1> hs(self_); + Handle exception_ref(hs.NewHandle(exception)); if (kDebugExceptionDelivery) { - mirror::String* msg = exception->GetDetailMessage(); + ObjPtr msg = exception_ref->GetDetailMessage(); std::string str_msg(msg != nullptr ? msg->ToModifiedUtf8() : ""); - self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << exception->PrettyTypeOf() + self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << exception_ref->PrettyTypeOf() << ": " << str_msg << "\n"); } - StackHandleScope<1> hs(self_); - Handle exception_ref(hs.NewHandle(exception)); // Walk the stack to find catch handler. CatchBlockStackVisitor visitor(self_, context_, &exception_ref, this); -- cgit v1.2.3-59-g8ed1b