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

Commit e740250b authored by Josh Gao's avatar Josh Gao
Browse files

crash_dump: clear the signal mask.

crash_dump inherits its signal mask from the thread that forked it,
which always has all of its signals blocked, now that sigchain respects
sa_mask.

Manually clear the signal mask, and reduce the timeout to a
still-generous 2 seconds.

Bug: http://b/38427757
Test: manually inserted sleep in crash_dump
Change-Id: If1c9adb68777b71fb19d9b0f47d6998733ed8f52
parent b46fd686
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -207,9 +207,14 @@ int main(int argc, char** argv) {
  action.sa_handler = signal_handler;
  debuggerd_register_handlers(&action);

  sigset_t mask;
  sigemptyset(&mask);
  if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
    PLOG(FATAL) << "failed to set signal mask";
  }

  if (argc != 4) {
    LOG(FATAL) << "Wrong number of args: " << argc << " (expected 4)";
    return 1;
  }

  pid_t main_tid;
@@ -264,7 +269,7 @@ int main(int argc, char** argv) {
  }

  // Die if we take too long.
  alarm(20);
  alarm(2);

  std::string attach_error;