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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial