Bug 1553717 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Attempting to make a Linux version of Tom's patch to understand what's going on didn't really work. It looks like malloc is already called before main() is interested, which makes inspecting and propagating the command line flags tricky:

#0  arena_t::arena_t (this=0x7ffff6b00000, aParams=0x7fffffffc900)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3531
#1  0x000055555558db21 in ArenaCollection::CreateArena (this=0x5555556398c8 <gArenas>, 
    aIsPrivate=false, aParams=0x7fffffffc900)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3605
#2  0x000055555558f49f in ArenaCollection::Init (this=<optimized out>)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:1065
#3  malloc_init_hard () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3983
#4  malloc_init () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:1219
#5  0x0000555555593e76 in Allocator<MozJemallocBase>::jemalloc_stats (aStats=0x7fffffffd570)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:4233
#6  0x00005555555ae991 in phc_init (aMallocTable=0x7fffffffd610, 
    aBridge=0x555555639738 <gReplaceMallocBridge>)
    at /home/morbo/hg/firefox/memory/replace/phc/PHC.cpp:1327
#7  0x000055555558e025 in init () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:4659
#8  0x000055555558e1cc in Allocator<ReplaceMallocBase>::malloc (arg1=72704)
    at /home/morbo/hg/firefox/memory/build/malloc_decls.h:51
#9  malloc (arg1=72704) at /home/morbo/hg/firefox/memory/build/malloc_decls.h:51
#10 0x00007ffff76b8426 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007ffff7de5733 in call_init (env=0x7fffffffd790, argv=0x7fffffffd768, argc=4, 
    l=<optimized out>) at dl-init.c:72
#12 _dl_init (main_map=0x7ffff7ffe170, argc=4, argv=0x7fffffffd768, env=0x7fffffffd790)
    at dl-init.c:119
#13 0x00007ffff7dd60ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
Attempting to make a Linux version of Tom's patch to understand what's going on didn't really work. It looks like malloc is already called before main() is entered which makes inspecting and propagating the command line flags tricky:

```
#0  arena_t::arena_t (this=0x7ffff6b00000, aParams=0x7fffffffc900)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3531
#1  0x000055555558db21 in ArenaCollection::CreateArena (this=0x5555556398c8 <gArenas>, 
    aIsPrivate=false, aParams=0x7fffffffc900)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3605
#2  0x000055555558f49f in ArenaCollection::Init (this=<optimized out>)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:1065
#3  malloc_init_hard () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:3983
#4  malloc_init () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:1219
#5  0x0000555555593e76 in Allocator<MozJemallocBase>::jemalloc_stats (aStats=0x7fffffffd570)
    at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:4233
#6  0x00005555555ae991 in phc_init (aMallocTable=0x7fffffffd610, 
    aBridge=0x555555639738 <gReplaceMallocBridge>)
    at /home/morbo/hg/firefox/memory/replace/phc/PHC.cpp:1327
#7  0x000055555558e025 in init () at /home/morbo/hg/firefox/memory/build/mozjemalloc.cpp:4659
#8  0x000055555558e1cc in Allocator<ReplaceMallocBase>::malloc (arg1=72704)
    at /home/morbo/hg/firefox/memory/build/malloc_decls.h:51
#9  malloc (arg1=72704) at /home/morbo/hg/firefox/memory/build/malloc_decls.h:51
#10 0x00007ffff76b8426 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007ffff7de5733 in call_init (env=0x7fffffffd790, argv=0x7fffffffd768, argc=4, 
    l=<optimized out>) at dl-init.c:72
#12 _dl_init (main_map=0x7ffff7ffe170, argc=4, argv=0x7fffffffd768, env=0x7fffffffd790)
    at dl-init.c:119
#13 0x00007ffff7dd60ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
```

Back to Bug 1553717 Comment 11