aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/icecat-bug-1414945.patch
blob: 3638ace1c49a181090da95292de576ed91279235 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Based on:
  https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/d303b3bb88c3

Adapted to apply cleanly to IceCat.

# HG changeset patch
# User Philip Chimento <philip.chimento@gmail.com>
# Date 1510012155 28800
# Node ID d303b3bb88c3345d3a089901e2b6fe883d148e44
# Parent  0152d097672f7e99504815cf7b06d9f303419fba
Bug 1414945 - Don't use TimeDuration in static initializer. r=jandem, a=ritu

On Darwin this would cause a race between two static initializers.

diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -138,17 +138,17 @@ static const size_t gMaxStackSize = 2 * 
 #else
 static const size_t gMaxStackSize = 128 * sizeof(size_t) * 1024;
 #endif
 
 /*
  * Limit the timeout to 30 minutes to prevent an overflow on platfoms
  * that represent the time internally in microseconds using 32-bit int.
  */
-static const TimeDuration MAX_TIMEOUT_INTERVAL = TimeDuration::FromSeconds(1800.0);
+static const double MAX_TIMEOUT_SECONDS = 1800.0;
 
 // SharedArrayBuffer and Atomics settings track IceCat.  Choose a custom setting
 // with --shared-memory={on,off}.
 #ifndef RELEASE_OR_BETA
 # define SHARED_MEMORY_DEFAULT 1
 #else
 # define SHARED_MEMORY_DEFAULT 0
 #endif
@@ -3518,16 +3518,17 @@ Sleep_fn(JSContext* cx, unsigned argc, V
         if (!ToNumber(cx, args[0], &t_secs))
             return false;
         if (mozilla::IsNaN(t_secs)) {
             JS_ReportErrorASCII(cx, "sleep interval is not a number");
             return false;
         }
 
         duration = TimeDuration::FromSeconds(Max(0.0, t_secs));
+        const TimeDuration MAX_TIMEOUT_INTERVAL = TimeDuration::FromSeconds(MAX_TIMEOUT_SECONDS);
         if (duration > MAX_TIMEOUT_INTERVAL) {
             JS_ReportErrorASCII(cx, "Excessive sleep interval");
             return false;
         }
     }
     {
         LockGuard<Mutex> guard(sc->watchdogLock);
         TimeStamp toWakeup = TimeStamp::Now() + duration;
@@ -3675,16 +3676,17 @@ CancelExecution(JSContext* cx)
 
 static bool
 SetTimeoutValue(JSContext* cx, double t)
 {
     if (mozilla::IsNaN(t)) {
         JS_ReportErrorASCII(cx, "timeout is not a number");
         return false;
     }
+    const TimeDuration MAX_TIMEOUT_INTERVAL = TimeDuration::FromSeconds(MAX_TIMEOUT_SECONDS);
     if (TimeDuration::FromSeconds(t) > MAX_TIMEOUT_INTERVAL) {
         JS_ReportErrorASCII(cx, "Excessive timeout value");
         return false;
     }
     GetShellContext(cx)->timeoutInterval = t;
     if (!ScheduleWatchdog(cx, t)) {
         JS_ReportErrorASCII(cx, "Failed to create the watchdog");
         return false;

tr> 2017-07-15Remove task from 'guix-daemon.conf'....Christopher Baines 2017-05-04etc: indent-code.el: Define source tree by "indent-code.el"....Alex Kost 2017-04-22Increase "TasksMax" in 'guix-daemon.service'....Sergei Trofimovich 2017-03-06build: Don't embed absolute paths in .service and .conf service files....Leo Famulari 2017-02-08etc: The pre-push hook says which commits failed the signature check....Leo Famulari 2017-02-07bash completion: Complete subcommands for the current word....Ludovic Courtès 2017-02-07bash completion: Properly complete 'guix container exec'....Ludovic Courtès 2017-02-07bash completion: Complete file names after 'guix system COMMAND'....Ludovic Courtès 2017-02-07bash completion: Complete 'guix gc' with file names....Ludovic Courtès 2017-01-20etc: indent-code.el: Add indentation info for non-Guix Scheme constructs....Ludovic Courtès 2017-01-13etc: Support indentation of whole files....Ludovic Courtès 2017-01-12etc: Add 'indent-package.el' script....Ludovic Courtès 2017-01-04doc: Add a Git hook that verifies signatures before pushing....Leo Famulari 2016-11-24Add system start-up files for "guix publish"....Hartmut Goebel 2016-09-07bash completion: Complete subcommands and their options....Ludovic Courtès 2016-09-07bash completion: Redirect 'guix' stderr to /dev/null....Ludovic Courtès 2016-09-07Add Zsh completion file....Eric Le Bihan 2016-07-18Set "GUIX_LOCPATH" in 'guix-daemon.service'....Ricardo Wurmus 2016-04-25Add "TasksMax=1024" in 'guix-daemon.service'....Ludovic Courtès 2015-11-26Add 'guix-daemon.conf' job for Upstart....Mario Daniel Ruiz Saavedra 2015-08-20bash completion: Cache the list of subcommands and available packages....Ludovic Courtès 2015-07-15Add 'guix-daemon.service' file for systemd....Ludovic Courtès 2015-05-01bash completion: Complete long options with no short variant....Ludovic Courtès 2015-04-09Add Bash completion file....Ludovic Courtès