diff --git a/debuggerd/include/debuggerd/handler.h b/debuggerd/include/debuggerd/handler.h index 809f67049..7196e0ad4 100644 --- a/debuggerd/include/debuggerd/handler.h +++ b/debuggerd/include/debuggerd/handler.h @@ -48,6 +48,7 @@ static void __attribute__((__unused__)) debuggerd_register_handlers(struct sigac #if defined(SIGSTKFLT) sigaction(SIGSTKFLT, action, nullptr); #endif + sigaction(SIGSYS, action, nullptr); sigaction(SIGTRAP, action, nullptr); sigaction(DEBUGGER_SIGNAL, action, nullptr); } diff --git a/debuggerd/tombstoned/tombstoned.cpp b/debuggerd/tombstoned/tombstoned.cpp index 63e3dbd07..8705ecea5 100644 --- a/debuggerd/tombstoned/tombstoned.cpp +++ b/debuggerd/tombstoned/tombstoned.cpp @@ -85,7 +85,13 @@ static void find_oldest_tombstone() { std::string path = android::base::StringPrintf("%stombstone_%02zu", kTombstoneDirectory, i); struct stat st; if (stat(path.c_str(), &st) != 0) { - PLOG(ERROR) << "failed to stat " << path; + if (errno == ENOENT) { + oldest_tombstone = i; + break; + } else { + PLOG(ERROR) << "failed to stat " << path; + continue; + } } if (st.st_mtime < oldest_time) { diff --git a/debuggerd/tombstoned/tombstoned.rc b/debuggerd/tombstoned/tombstoned.rc index eaae9c475..b8345cacf 100644 --- a/debuggerd/tombstoned/tombstoned.rc +++ b/debuggerd/tombstoned/tombstoned.rc @@ -2,6 +2,9 @@ service tombstoned /system/bin/tombstoned user tombstoned group system + # Don't start tombstoned until after the real /data is mounted. + class late_start + socket tombstoned_crash seqpacket 0666 system system socket tombstoned_intercept seqpacket 0666 system system writepid /dev/cpuset/system-background/tasks diff --git a/rootdir/init.rc b/rootdir/init.rc index 8d974fa12..d6ae6f0d9 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -359,9 +359,6 @@ on post-fs-data start vold installkey /data - # start tombstoned to record early-boot crashes. - start tombstoned - # Start bootcharting as soon as possible after the data partition is # mounted to collect more data. mkdir /data/bootchart 0755 shell shell