Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262205 - =www-client/mozilla-firefox-3.0* doesn't use libjemalloc.so
Summary: =www-client/mozilla-firefox-3.0* doesn't use libjemalloc.so
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 2 votes (vote)
Assignee: Mozilla Gentoo Team
URL: http://blog.pavlov.net/2008/02/27/jem...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 22:12 UTC by Davide Pesavento
Modified: 2009-08-02 11:06 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Pesavento gentoo-dev 2009-03-11 22:12:49 UTC
Since version 3.0, firefox uses a custom malloc() implementation, called jemalloc (see $URL for more info).
The library is correctly installed in /usr/lib64/mozilla-firefox/libjemalloc.so on my system (amd64), but it is not loaded and thus firefox fallbacks to the standard glibc implementation of malloc(). This is demonstrated by inspecting the process's memory map as reported by the kernel.

Actual result:
# grep jemalloc /proc/$(pidof firefox)/maps
[no output]

Expected result (obtained with the proposed fix shown below):
# grep jemalloc /proc/$(pidof firefox)/maps
7f9df4b7d000-7f9df4b85000 r-xp 00000000 08:03 13704674                   /usr/lib64/mozilla-firefox/libjemalloc.so
7f9df4b85000-7f9df4d85000 ---p 00008000 08:03 13704674                   /usr/lib64/mozilla-firefox/libjemalloc.so
7f9df4d85000-7f9df4d86000 r--p 00008000 08:03 13704674                   /usr/lib64/mozilla-firefox/libjemalloc.so
7f9df4d86000-7f9df4d87000 rw-p 00009000 08:03 13704674                   /usr/lib64/mozilla-firefox/libjemalloc.so

Proposed fix:
Add LD_PRELOAD="/usr/lib64/mozilla-firefox/libjemalloc.so" in the wrapper script (/usr/bin/firefox).
Comment 1 Anthony Mattheakakis 2009-06-17 17:11:21 UTC
This really needs to be fixed. It helps with memory management substantially.
Comment 2 Davide Pesavento gentoo-dev 2009-07-24 16:23:09 UTC
Firefox 3.5.x no longer installs libjemalloc.so, does anyone know what happened?
Comment 3 Jory A. Pratt gentoo-dev 2009-07-25 22:42:50 UTC
libjemalloc.so is linked into final binary.
Comment 4 Davide Pesavento gentoo-dev 2009-07-26 10:24:22 UTC
Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked in the final binary. However this bug is about firefox-3.0* which still has the issue, so I'm reopening.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-07-27 04:19:14 UTC
Removing amd64@g.o from CC. The responsible herd is already assigned here.
Comment 6 Jory A. Pratt gentoo-dev 2009-07-27 12:51:01 UTC
everyone on bug report please post emerge -pv mozilla-firefox please.
Comment 7 Davide Pesavento gentoo-dev 2009-07-28 14:59:34 UTC
# emerge -pv mozilla-firefox

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] www-client/mozilla-firefox-3.5.1  USE="dbus java startup-notification -bindist -custom-optimization -gnome -iceweasel -mozdevelop -restrict-javascript" LINGUAS="it -af -ar -as -be -bg -bn -bn_BD -bn_IN -ca -cs -cy -da -de -el -en -en_GB -en_US -eo -es -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy -fy_NL -ga -ga_IE -gl -gu -gu_IN -he -hi -hi_IN -hr -hu -id -is -ja -ka -kk -kn -ko -ku -lt -lv -mk -ml -mn -mr -nb -nb_NO -nl -nn -nn_NO -oc -or -pa -pa_IN -pl -pt -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -sq -sr -sv -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW" 0 kB

(I upgraded to 3.5 when it got unmasked last week, but I kept the USE flags unchanged)
Comment 8 Jory A. Pratt gentoo-dev 2009-07-28 22:08:34 UTC
(In reply to comment #7)
> # emerge -pv mozilla-firefox
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [ebuild   R   ] www-client/mozilla-firefox-3.5.1  USE="dbus java
> startup-notification -bindist -custom-optimization -gnome -iceweasel
> -mozdevelop -restrict-javascript" LINGUAS="it -af -ar -as -be -bg -bn -bn_BD
> -bn_IN -ca -cs -cy -da -de -el -en -en_GB -en_US -eo -es -es_AR -es_CL -es_ES
> -es_MX -et -eu -fa -fi -fr -fy -fy_NL -ga -ga_IE -gl -gu -gu_IN -he -hi -hi_IN
> -hr -hu -id -is -ja -ka -kk -kn -ko -ku -lt -lv -mk -ml -mn -mr -nb -nb_NO -nl
> -nn -nn_NO -oc -or -pa -pa_IN -pl -pt -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -sq
> -sr -sv -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW" 0 kB
> 
> (I upgraded to 3.5 when it got unmasked last week, but I kept the USE flags
> unchanged)
> 

Invalid, this is about firefox-3.0.x libjemalloc is linked in against final binary of new firefox, any else with this issue that is using firefox-3.0.x please comment soon or bug will be closed invalid. If you are using xulrunner useflag in 3.0.x your libjemalloc comes from xulrunner not firefox.
Comment 9 Jory A. Pratt gentoo-dev 2009-07-31 23:59:03 UTC
(In reply to comment #4)
> Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked
> in the final binary. However this bug is about firefox-3.0* which still has the
> issue, so I'm reopening.
> 

I have confirmed that the file is installed when not built against xulrunner, it is installed by xulrunner if xulrunner useflag is enabled bug is invalid.
Comment 10 Davide Pesavento gentoo-dev 2009-08-02 11:06:34 UTC
(In reply to comment #9)
> (In reply to comment #4)
> > Yes, in firefox-3.5 jemalloc is built as a static archive which is then linked
> > in the final binary. However this bug is about firefox-3.0* which still has the
> > issue, so I'm reopening.
> > 
> 
> I have confirmed that the file is installed when not built against xulrunner,
> it is installed by xulrunner if xulrunner useflag is enabled bug is invalid.
> 

My firefox-3.0.x had the xulrunner USE flag enabled, libjemalloc.so was installed but wasn't being used. Please explain why this is invalid.

(OTOH, I really don't care about this bug anymore since I've upgraded to 3.5 which doesn't have this issue.)