25556325 Firefox 45 sometimes generates core file on exit
authorjiri.kralovec@oracle.com <jiri.kralovec@oracle.com>
Fri, 07 Apr 2017 00:53:32 -0700
changeset 7846 eaed6d702f04
parent 7845 04bd13eb1a17
child 7847 ec4c46e50642
25556325 Firefox 45 sometimes generates core file on exit
components/desktop/firefox/patches/firefox-55-terminator.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-55-terminator.patch	Fri Apr 07 00:53:32 2017 -0700
@@ -0,0 +1,54 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1232285
+https://bugzilla.mozilla.org/show_bug.cgi?id=1252382
+
+And a fix to 1232285, which introduced division of crashAfterMS
+by PR_MillisecondsToInterval(1000). crashAfterMS has to be divided
+by 1000 to get number of seconds.
+
+--- a/toolkit/components/terminator/nsTerminator.cpp
++++ b/toolkit/components/terminator/nsTerminator.cpp
+@@ -33,6 +33,12 @@
+ #include "nsExceptionHandler.h"
+ #endif
+ 
++#if defined(XP_WIN)
++#include <windows.h>
++#else
++#include <unistd.h>
++#endif
++
+ #include "mozilla/ArrayUtils.h"
+ #include "mozilla/Attributes.h"
+ #include "mozilla/DebugOnly.h"
+@@ -53,9 +59,6 @@
+ // forcefully.
+ #define ADDITIONAL_WAIT_BEFORE_CRASH_MS 3000
+ 
+-// One second, in ticks.
+-#define TICK_DURATION 1000
+-
+ namespace mozilla {
+ 
+ namespace {
+@@ -141,7 +144,11 @@
+     // we have lost at most one second, which is much
+     // more reasonable.
+     //
+-    PR_Sleep(TICK_DURATION);
++#if defined(XP_WIN)
++        Sleep(1000 /* ms */);
++#else
++        usleep(1000000 /* usec */);
++#endif
+ 
+     if (gHeartbeat++ < timeToLive) {
+       continue;
+@@ -378,7 +385,7 @@
+   }
+ 
+   UniquePtr<Options> options(new Options());
+-  options->crashAfterTicks = crashAfterMS / TICK_DURATION;
++  options->crashAfterTicks = crashAfterMS / 1000;
+ 
+   DebugOnly<PRThread*> watchdogThread = CreateSystemThread(RunWatchdog,
+                                                 options.release());