Bug 1478143 - Adjust default malloc_context_size for ASan builds. r?froydnj draft
authorChristian Holler <choller@mozilla.com>
Tue, 24 Jul 2018 23:01:21 +0200
changeset 822177 d727e022d8fc4150fc0b8c585358cdc2f99eff9e
parent 822176 2cd46d9846a27f2321b42d3aa697aed30cf44850
push id117304
push usercholler@mozilla.com
push dateTue, 24 Jul 2018 21:02:47 +0000
reviewersfroydnj
bugs1478143
milestone63.0a1
Bug 1478143 - Adjust default malloc_context_size for ASan builds. r?froydnj MozReview-Commit-ID: BbYWTtrsHLH
mozglue/build/AsanOptions.cpp
--- a/mozglue/build/AsanOptions.cpp
+++ b/mozglue/build/AsanOptions.cpp
@@ -43,18 +43,24 @@
 //   skipped.
 //
 //   malloc_fill_byte / free_fill_byte - These values specify the byte values
 //   used to initialize/overwrite memory in conjunction with the previous
 //   options max_malloc_fill_size and max_free_fill_size. The values used here
 //   are 0xe4 and 0xe5 to match the kAllocPoison and kAllocJunk constants used
 //   by mozjemalloc.
 //
+//   malloc_context_size - This value specifies how many stack frames are
+//   stored for each malloc and free call. Since Firefox can have lots of deep
+//   stacks with allocations, we limit the default size here further to save
+//   some memory.
+//
 extern "C" MOZ_ASAN_BLACKLIST
 const char* __asan_default_options() {
     return "allow_user_segv_handler=1:alloc_dealloc_mismatch=0:detect_leaks=0"
+           ":malloc_context_size=20"
            ":max_free_fill_size=268435456:max_malloc_fill_size=268435456"
            ":malloc_fill_byte=228:free_fill_byte=229"
            ":handle_sigill=1"
            ":allocator_may_return_null=1";
 }
 
 #endif