firefox: 52.2.0esr
[unleashed-userland.git] / components / web / firefox / patches / 21-terminator.patch
blob616134cb1d3388628abac4e656f86faf9198e787
1 From ef476662153730c082c0a42e9b284d97ff2bdda5 Mon Sep 17 00:00:00 2001
2 From: "jiri.kralovec@oracle.com" <jiri.kralovec@oracle.com>
3 Date: Fri, 7 Apr 2017 00:53:32 -0700
4 Subject: [PATCH] 25556325 Firefox 45 sometimes generates core file on exit
6 ---
7 .../firefox/patches/firefox-55-terminator.patch | 54 ++++++++++++++++++++++
8 1 file changed, 54 insertions(+)
9 create mode 100644 components/desktop/firefox/patches/firefox-55-terminator.patch
11 diff --git a/components/desktop/firefox/patches/firefox-55-terminator.patch b/components/desktop/firefox/patches/firefox-55-terminator.patch
12 new file mode 100644
13 index 0000000..3cfbfba
14 --- /dev/null
15 +++ b/components/desktop/firefox/patches/firefox-55-terminator.patch
16 @@ -0,0 +1,54 @@
17 +https://bugzilla.mozilla.org/show_bug.cgi?id=1232285
18 +https://bugzilla.mozilla.org/show_bug.cgi?id=1252382
20 +And a fix to 1232285, which introduced division of crashAfterMS
21 +by PR_MillisecondsToInterval(1000). crashAfterMS has to be divided
22 +by 1000 to get number of seconds.
24 +--- a/toolkit/components/terminator/nsTerminator.cpp
25 ++++ b/toolkit/components/terminator/nsTerminator.cpp
26 +@@ -33,6 +33,12 @@
27 + #include "nsExceptionHandler.h"
28 + #endif
30 ++#if defined(XP_WIN)
31 ++#include <windows.h>
32 ++#else
33 ++#include <unistd.h>
34 ++#endif
36 + #include "mozilla/ArrayUtils.h"
37 + #include "mozilla/Attributes.h"
38 + #include "mozilla/DebugOnly.h"
39 +@@ -53,9 +59,6 @@
40 + // forcefully.
41 + #define ADDITIONAL_WAIT_BEFORE_CRASH_MS 3000
43 +-// One second, in ticks.
44 +-#define TICK_DURATION 1000
46 + namespace mozilla {
48 + namespace {
49 +@@ -141,7 +144,11 @@
50 + // we have lost at most one second, which is much
51 + // more reasonable.
52 + //
53 +- PR_Sleep(TICK_DURATION);
54 ++#if defined(XP_WIN)
55 ++ Sleep(1000 /* ms */);
56 ++#else
57 ++ usleep(1000000 /* usec */);
58 ++#endif
60 + if (gHeartbeat++ < timeToLive) {
61 + continue;
62 +@@ -378,7 +385,7 @@
63 + }
65 + UniquePtr<Options> options(new Options());
66 +- options->crashAfterTicks = crashAfterMS / TICK_DURATION;
67 ++ options->crashAfterTicks = crashAfterMS / 1000;
69 + DebugOnly<PRThread*> watchdogThread = CreateSystemThread(RunWatchdog,
70 + options.release());