malloc_init deadlock (mozilla jemalloc)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mozilla Firefox |
Invalid
|
Medium
|
|||
firefox-3.0 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I submitted this as a bug against mozilla (https:/
malloc_init calls malloc_ncpus which in turn calls malloc_init trapping itself
in malloc_mutex_lock. I see this on a Ubuntu 8.04 server but not on a Ubuntu
8.10 laptop, but there may be other differences. The traceback that follows shows that on 8.04 that calloc calls malloc_init which acquires a futex, and tries to "open" /proc/cpuinfo to see how many cpus there are. However, open calls malloc and gets caught in the futex.
This is the mozilla jemalloc malloc replacement, but I don't know why this occurs on the 8.04 server box and not the 8.10 laptop.
Here is a traceback:
#0 malloc_init_hard ()
at /var/dept/
#1 0x08056c22 in malloc_init ()
at /var/dept/
#2 0x08057411 in calloc (num=1, size=20)
at /var/dept/
#3 0xb7c3332c in ?? () from /lib/tls/
#4 0xb7c32d73 in dlsym () from /lib/tls/
#5 0xb7efe97a in open (path=0x805800f "/proc/cpuinfo", oflag=0, mode=0)
at libc_ut.c:97
#6 0x08054388 in malloc_ncpus ()
at /var/dept/
#7 0x08055edf in malloc_init_hard ()
at /var/dept/
#8 0x08056c22 in malloc_init ()
at /var/dept/
#9 0x08057411 in calloc (num=1, size=20)
at /var/dept/
#10 0xb7c3332c in ?? () from /lib/tls/
#11 0xb7c32b51 in dlopen () from /lib/tls/
#12 0xb7c4b443 in pr_FindSymbolInProg (name=0x0)
at /var/dept/
#13 0xb7c4b52f in _PR_InitZones ()
---Type <return> to continue, or q <return> to quit---
at /var/dept/
#14 0xb7c510c1 in _PR_InitStuff ()
at /var/dept/
#15 0xb7c62568 in PR_GetCurrentThread ()
at /var/dept/
#16 0xb7ca134b in nsAutoOwningThread (this=0xb7d44974)
at ../../.
#17 0xb7d0d70f in __static_
__initializ
at /var/dept/
#18 0xb7d2b685 in __do_global_
from ./objdir-
#19 0xb7c9c7b0 in _init () from ./objdir-
#20 0xb7f11990 in ?? () from /lib/ld-linux.so.2
#21 0xb7f11ac3 in ?? () from /lib/ld-linux.so.2
#22 0xb7f0484f in ?? () from /lib/ld-linux.so.2
Changed in firefox: | |
status: | Unknown → New |
Changed in firefox: | |
status: | New → Invalid |
Changed in firefox: | |
importance: | Unknown → Medium |
I submitted this as a bug against mozilla (https:/ /bugzilla. mozilla. org/show_ bug.cgi? id=474155) but there has been no feedback there, This occurs in the firefox 3.1 builds
malloc_init calls malloc_ncpus which in turn calls malloc_init trapping itself
in malloc_mutex_lock. I see this on a Ubuntu 8.04 server but not on a Ubuntu
8.10 laptop, but there may be other differences. The traceback that follows shows that on 8.04 that calloc calls malloc_init which acquires a futex, and tries to "open" /proc/cpuinfo to see how many cpus there are. However, open calls malloc and gets caught in the futex.
This is the mozilla jemalloc malloc replacement, but I don't know why this occurs on the 8.04 server box and not the 8.10 laptop.
Here is a traceback:
#0 malloc_init_hard () scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:5383 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:5362 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:6098 i686/cmov/ libdl.so. 2 i686/cmov/ libdl.so. 2 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:5111 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:5415 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:5362 scratch/ km/src/ mozilla/ memory/ jemalloc/ jemalloc. c:6098 i686/cmov/ libdl.so. 2 i686/cmov/ libdl.so. 2 scratch/ km/src/ mozilla/ nsprpub/ pr/src/ malloc/ prmem.c: 130 scratch/ km/src/ mozilla/ nsprpub/ pr/src/ malloc/ prmem.c: 186 scratch/ km/src/ mozilla/ nsprpub/ pr/src/ misc/prinit. c:172 scratch/ km/src/ mozilla/ nsprpub/ pr/src/ pthreads/ ptthread. c:646 ./../dist/ include/ xpcom/nsISuppor tsImpl. h:70 initialization_ and_destruction _0 ( e_p=<value optimized out>, __priority=0) scratch/ km/src/ mozilla/ xpcom/base/ nsTraceRefcntIm pl.cpp: 1287 ctors_aux () ff/dist/ bin/libxpcom_ core.so ff/dist/ bin/libxpcom_ core.so
at /var/dept/
#1 0x08056c22 in malloc_init ()
at /var/dept/
#2 0x08057411 in calloc (num=1, size=20)
at /var/dept/
#3 0xb7c3332c in ?? () from /lib/tls/
#4 0xb7c32d73 in dlsym () from /lib/tls/
#5 0xb7efe97a in open (path=0x805800f "/proc/cpuinfo", oflag=0, mode=0)
at libc_ut.c:97
#6 0x08054388 in malloc_ncpus ()
at /var/dept/
#7 0x08055edf in malloc_init_hard ()
at /var/dept/
#8 0x08056c22 in malloc_init ()
at /var/dept/
#9 0x08057411 in calloc (num=1, size=20)
at /var/dept/
#10 0xb7c3332c in ?? () from /lib/tls/
#11 0xb7c32b51 in dlopen () from /lib/tls/
#12 0xb7c4b443 in pr_FindSymbolInProg (name=0x0)
at /var/dept/
#13 0xb7c4b52f in _PR_InitZones ()
---Type <return> to continue, or q <return> to quit---
at /var/dept/
#14 0xb7c510c1 in _PR_InitStuff ()
at /var/dept/
#15 0xb7c62568 in PR_GetCurrentThread ()
at /var/dept/
#16 0xb7ca134b in nsAutoOwningThread (this=0xb7d44974)
at ../../.
#17 0xb7d0d70f in __static_
__initializ
at /var/dept/
#18 0xb7d2b685 in __do_global_
from ./objdir-
#19 0xb7c9c7b0 in _init () from ./objdir-
#20 0xb7f11990 in ?? () from /lib/ld-linux.so.2
#21 0xb7f11ac3 in ?? () from /lib/ld-linux.so.2
#22 0xb7f0484f in ?? () from /lib/ld-linux.so.2