toolkit/crashreporter/breakpad-patches/17-bug942407-usersig.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/breakpad-patches/17-bug942407-usersig.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +# HG changeset patch
     1.5 +# User Jed Davis <jld@mozilla.com>
     1.6 +
     1.7 +Bug 942407: Fix breakpad signal handler's test for signal origin. r=ted
     1.8 +
     1.9 +
    1.10 +diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
    1.11 +index 55834e0..df958fb 100644
    1.12 +--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
    1.13 ++++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
    1.14 +@@ -334,20 +334,20 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
    1.15 +   if (handled) {
    1.16 +     signal(sig, SIG_DFL);
    1.17 +   } else {
    1.18 +     RestoreHandlersLocked();
    1.19 +   }
    1.20 + 
    1.21 +   pthread_mutex_unlock(&handler_stack_mutex_);
    1.22 + 
    1.23 +-  if (info->si_pid) {
    1.24 +-    // This signal was triggered by somebody sending us the signal with kill().
    1.25 +-    // In order to retrigger it, we have to queue a new signal by calling
    1.26 +-    // kill() ourselves.
    1.27 ++  if (info->si_code <= 0) {
    1.28 ++    // This signal was sent by another process.  (Positive values of
    1.29 ++    // si_code are reserved for kernel-originated signals.)  In order
    1.30 ++    // to retrigger it, we have to queue a new signal.
    1.31 +     if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
    1.32 +       // If we failed to kill ourselves (e.g. because a sandbox disallows us
    1.33 +       // to do so), we instead resort to terminating our process. This will
    1.34 +       // result in an incorrect exit code.
    1.35 +       _exit(1);
    1.36 +     }
    1.37 +   } else {
    1.38 +     // This was a synchronous signal triggered by a hard fault (e.g. SIGSEGV).
    1.39 +-- 
    1.40 +1.8.4.rc3
    1.41 +

mercurial