Merge "fdtrack: emit the most common stack in the abort message." am: 3a95fb9b50

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633025

Change-Id: Id3a32fcd8f0de8be5b9080fd218c47951d1b43f7
This commit is contained in:
Josh Gao
2021-03-16 02:08:59 +00:00
committed by Automerger Merge Worker

View File

@@ -100,16 +100,9 @@ static void android_server_SystemServer_initZygoteChildHeapProfiling(JNIEnv* /*
}
static void android_server_SystemServer_fdtrackAbort(JNIEnv*, jobject) {
raise(BIONIC_SIGNAL_FDTRACK);
// Wait for a bit to allow fdtrack to dump backtraces to logcat.
std::this_thread::sleep_for(5s);
// Abort on a different thread to avoid ART dumping runtime stacks.
std::thread([]() {
LOG_ALWAYS_FATAL("b/140703823: aborting due to fd leak: check logs for fd "
"backtraces");
}).join();
sigval val;
val.sival_int = 1;
sigqueue(getpid(), BIONIC_SIGNAL_FDTRACK, val);
}
static jlong android_server_SystemServer_startIncrementalService(JNIEnv* env, jclass klass,