michael@0: # HG changeset patch michael@0: # User Jed Davis michael@0: michael@0: Bug 942407: Fix breakpad signal handler's test for signal origin. r=ted michael@0: michael@0: michael@0: 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 michael@0: index 55834e0..df958fb 100644 michael@0: --- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc michael@0: +++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc michael@0: @@ -334,20 +334,20 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { michael@0: if (handled) { michael@0: signal(sig, SIG_DFL); michael@0: } else { michael@0: RestoreHandlersLocked(); michael@0: } michael@0: michael@0: pthread_mutex_unlock(&handler_stack_mutex_); michael@0: michael@0: - if (info->si_pid) { michael@0: - // This signal was triggered by somebody sending us the signal with kill(). michael@0: - // In order to retrigger it, we have to queue a new signal by calling michael@0: - // kill() ourselves. michael@0: + if (info->si_code <= 0) { michael@0: + // This signal was sent by another process. (Positive values of michael@0: + // si_code are reserved for kernel-originated signals.) In order michael@0: + // to retrigger it, we have to queue a new signal. michael@0: if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { michael@0: // If we failed to kill ourselves (e.g. because a sandbox disallows us michael@0: // to do so), we instead resort to terminating our process. This will michael@0: // result in an incorrect exit code. michael@0: _exit(1); michael@0: } michael@0: } else { michael@0: // This was a synchronous signal triggered by a hard fault (e.g. SIGSEGV). michael@0: -- michael@0: 1.8.4.rc3 michael@0: