On Sun, Mar 12, 2017 at 10:00:55PM +0100, frantisek holop wrote:
> it seems that i can 100% crash firefox by trying to use
> the web.whatsapp.com client for varying lengths of
> time.  this seems to be a regression, is anyone else
> seeing this?
> 

with firefox-52.0, the way memory allocation is done for javascript has
changed:

  - Bug 1334933 - Allocate executable pages from a pre-reserved range.
    https://hg.mozilla.org/releases/mozilla-release/rev/6b35bbf96b67

and in the same release, the size of initial malloc has been raised from
640Mo to 1Go:

  - Bug 1337561 - Baldr: call largeAllocationCallback and retry if executable 
allocation fails. r=jandem, a=jcristau
    https://hg.mozilla.org/releases/mozilla-release/rev/65bb26d07408


It makes firefox to malloc a chunk of 1Go at startup.

As you crash after the start, I assume you are running in "staff" class
or have modified login.conf datastack-cur value in "default" class.

The current way to deal with that is to raise your datastack-cur to make
firefox to fit in...


Alternatively, I would be glad if someone could test the diff below: I
run with it, but I don't use javascript enough to be sure the allocation
isn't too low.

It makes the allocation to be 128 Mo instead of 1 Go on 64bits platform
(it is the same value than for 32 bits platform in fact).

Note that the value is the total allocated bytes for javascript. It
isn't a initial value, and it shouldn't grow (if I correctly understand
the code). So I expect 128 Mo to be a bit "restrictive".

Thanks.
-- 
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/mozilla-firefox/Makefile,v
retrieving revision 1.311
diff -u -p -r1.311 Makefile
--- Makefile    7 Mar 2017 15:31:38 -0000       1.311
+++ Makefile    13 Mar 2017 05:27:26 -0000
@@ -5,6 +5,7 @@ COMMENT =       Mozilla web browser
 # Don't forget to bump www/firefox-i18n after updates.
 
 MOZILLA_VERSION =      52.0
+REVISION =             0
 MOZILLA_BRANCH =       release
 MOZILLA_PROJECT =      firefox
 MOZILLA_CODENAME =     browser
Index: patches/patch-js_src_jit_ProcessExecutableMemory_cpp
===================================================================
RCS file: patches/patch-js_src_jit_ProcessExecutableMemory_cpp
diff -N patches/patch-js_src_jit_ProcessExecutableMemory_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-js_src_jit_ProcessExecutableMemory_cpp        13 Mar 2017 
05:27:26 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+Allocate only few bytes for javascript
+--- js/src/jit/ProcessExecutableMemory.cpp.orig        Sat Mar 11 13:28:15 2017
++++ js/src/jit/ProcessExecutableMemory.cpp     Sun Mar 12 06:01:39 2017
+@@ -390,7 +390,7 @@ class PageBitSet
+ #if JS_BITS_PER_WORD == 32
+ static const size_t MaxCodeBytesPerProcess = 128 * 1024 * 1024;
+ #else
+-static const size_t MaxCodeBytesPerProcess = 1 * 1024 * 1024 * 1024;
++static const size_t MaxCodeBytesPerProcess = 128 * 1024 * 1024;
+ #endif
+ 
+ // Per-process executable memory allocator. It reserves a block of memory of

Reply via email to