Bug 2260766 - Build Firefox with support for replacing the malloc
Summary: Build Firefox with support for replacing the malloc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 39
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2262277 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-01-28 16:48 UTC by Henning
Modified: 2024-02-07 00:17 UTC (History)
6 users (show)

Fixed In Version: firefox-122.0-5.fc40
Clone Of:
Environment:
Last Closed: 2024-01-30 12:13:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Henning 2024-01-28 16:48:43 UTC
Description of problem:
I am using hardened_malloc on Fedora 39. It works perfectly fine for everything apart Firefox. Firefox uses its own allocator "jemalloc" and somehow these interfere.

I built firefox with this:

ac_add_options --enable-optimize --disable-jemalloc --enable-project=browser

the result works perfectly fine, I verified it uses hardened_malloc and ran the Web Basemark with it, without a single issue.

Now it should also be possible to still use the regular build, and still use hardened_malloc if the OS preloads it.

ac_add_options --enable-optimize --enable-replace-malloc --enable-project=browser

this way a LD_PRELOAD=/usr/lib64/libhardened_malloc.so firefox will use it instead. In the current situation it does not launch and I get memory issues.


Version-Release number of selected component (if applicable):
latest F39

How reproducible:
always when LD_PRELOAD ing hardened_malloc. I use the Secureblue kinoite-laptop-userns-hardened image.

Steps to Reproduce:
1. use secureblue or manually apply these changes to use hardened_malloc
2. run firefox in a terminal
3. now compile it yourself with that argument and run it again

Actual results:
Firefox does not work when using hardened_malloc, because it doesnt seem to be built with allowing to replace the malloc

Expected results:
If the OS does LD_PRELOAD then Firefox should also use that. The easiest solution would be to apply this build argument.

Comment 1 Martin Stransky 2024-01-30 12:13:50 UTC
Added to 122.0-4.

Comment 2 Fedora Update System 2024-02-01 19:20:14 UTC
FEDORA-2024-7af93e63f3 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-7af93e63f3

Comment 3 Fedora Update System 2024-02-01 21:13:21 UTC
FEDORA-2024-7af93e63f3 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Henning 2024-02-01 23:23:09 UTC
Cool, thank you!

Comment 5 Henning 2024-02-07 00:17:43 UTC
*** Bug 2262277 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.