25556325 Firefox 45 sometimes generates core file on exit s11u3-sru
authorjiri.kralovec@oracle.com <jiri.kralovec@oracle.com>
Tue, 25 Apr 2017 00:30:07 -0700
branchs11u3-sru
changeset 7944 8206eb363f71
parent 7943 b8bc80d358b2
child 7946 165bf092aa9c
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	Tue Apr 25 00:30:07 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());