From 0fcf4a605daa4f7cd43eddbf25cfe22d4e2bc391 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Fri, 10 Apr 2020 18:02:42 -0700 Subject: [PATCH] Don't call exit() with threads running Otherwise running threads race with destructors. Bug: 150176543 Test: Build and boot AOSP Change-Id: I159164a36d9808ae86c2928271b14736178e127b --- core/jni/AndroidRuntime.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index a2a671687eb6a..6c802006b964b 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -1285,12 +1285,11 @@ void AndroidRuntime::exit(int code) { if (mExitWithoutCleanup) { ALOGI("VM exiting with result code %d, cleanup skipped.", code); - ::_exit(code); } else { ALOGI("VM exiting with result code %d.", code); onExit(code); - ::exit(code); } + ::_exit(code); } void AndroidRuntime::onVmCreated(JNIEnv* env)