Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97805c05 authored by Josh Gao's avatar Josh Gao Committed by Automerger Merge Worker
Browse files

Merge "fdtrack: emit the most common stack in the abort message." am: 3a95fb9b am: 5a762e7d

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

Change-Id: I0a3d15a589dca33c11c7f76522774ca47fa69687
parents f30c9c80 5a762e7d
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -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,