Merge "crash_dump: defuse our signal handlers earlier."
am: c314d4db9f
Change-Id: I84666ea2b3239e013a02891fe3ca89e44966f151
This commit is contained in:
commit
e315b34fd8
|
@ -190,6 +190,19 @@ static bool g_tombstoned_connected = false;
|
|||
static unique_fd g_tombstoned_socket;
|
||||
static unique_fd g_output_fd;
|
||||
|
||||
static void DefuseSignalHandlers() {
|
||||
// Don't try to dump ourselves.
|
||||
struct sigaction action = {};
|
||||
action.sa_handler = SIG_DFL;
|
||||
debuggerd_register_handlers(&action);
|
||||
|
||||
sigset_t mask;
|
||||
sigemptyset(&mask);
|
||||
if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
|
||||
PLOG(FATAL) << "failed to set signal mask";
|
||||
}
|
||||
}
|
||||
|
||||
static void Initialize(char** argv) {
|
||||
android::base::InitLogging(argv);
|
||||
android::base::SetAborter([](const char* abort_msg) {
|
||||
|
@ -213,17 +226,6 @@ static void Initialize(char** argv) {
|
|||
|
||||
_exit(1);
|
||||
});
|
||||
|
||||
// Don't try to dump ourselves.
|
||||
struct sigaction action = {};
|
||||
action.sa_handler = SIG_DFL;
|
||||
debuggerd_register_handlers(&action);
|
||||
|
||||
sigset_t mask;
|
||||
sigemptyset(&mask);
|
||||
if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
|
||||
PLOG(FATAL) << "failed to set signal mask";
|
||||
}
|
||||
}
|
||||
|
||||
static void ParseArgs(int argc, char** argv, pid_t* pseudothread_tid, DebuggerdDumpType* dump_type) {
|
||||
|
@ -321,6 +323,8 @@ static pid_t wait_for_vm_process(pid_t pseudothread_tid) {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
DefuseSignalHandlers();
|
||||
|
||||
atrace_begin(ATRACE_TAG, "before reparent");
|
||||
pid_t target_process = getppid();
|
||||
|
||||
|
|
Loading…
Reference in New Issue