Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906509 - www-client/firefox (and other Mozilla packages): add Valgrind support
Summary: www-client/firefox (and other Mozilla packages): add Valgrind support
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-16 01:11 UTC by Sam James
Modified: 2023-06-06 19:23 UTC (History)
0 users

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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-16 01:11:17 UTC
Would it be possible to add --enable-valgrind (w/ USE=valgrind) to Firefox and the other Mozilla packages please?

This provides annotations to inform Valgrind of the internal allocator(s), see https://firefox-source-docs.mozilla.org/contributing/debugging/debugging_firefox_with_valgrind.html#build.

It not only reduced false positives/noise but it also means Valgrind can spot errors which it wouldn't be able to otherwise because memory might already be invalid to the internal allocator but not yet freed to the system.
Comment 1 Joonas Niilola gentoo-dev 2023-05-16 08:20:16 UTC
Does this need to be tied with 'debug' or is it useful without? 

I'd update the rapid build and sync with ESR + thunderbird + spidermonkey when the next ESR is out (115).
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-16 08:24:56 UTC
It's useful separately from USE=debug.

Here's why: Upstream guard stuff under MOZ_VALGRIND and then additionally, where relevant, RUNNING_ON_VALGRIND, which means a fair amount (not all) of the Valgrind-specific code is only triggered when you run e.g. valgrind /usr/bin/firefox.

So having USE=valgrind on doesn't make your Firefox dog slow or in a debug mode in the same way USE=debug does.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-16 08:25:58 UTC
(and thank you in advance!)
Comment 4 Larry the Git Cow gentoo-dev 2023-06-06 19:21:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39cfe283ccf6455b9781e4ac8ac15c9cf9937ed6

commit 39cfe283ccf6455b9781e4ac8ac15c9cf9937ed6
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-06-06 19:12:21 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-06-06 19:15:33 +0000

    www-client/firefox: add 114.0
    
     - enable 'valgrind' use flag,
     - include couple upstream skia patches from the upcoming 115 release,
     - increase ulimit in the ebuild when using mold linker and 'lto' use flag so
       the build does not fail.
    
    Bug: https://bugs.gentoo.org/838373
    Closes: https://bugs.gentoo.org/700934
    Closes: https://bugs.gentoo.org/905780
    Closes: https://bugs.gentoo.org/906509
    Closes: https://bugs.gentoo.org/907485
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest             |  101 +++
 www-client/firefox/firefox-114.0.ebuild | 1445 +++++++++++++++++++++++++++++++
 2 files changed, 1546 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91b6054d92693f0ae487f9863e6ff6f2e6f0fab5

commit 91b6054d92693f0ae487f9863e6ff6f2e6f0fab5
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-06-06 19:17:22 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-06-06 19:17:22 +0000

    profiles/base: package.use.mask www-client/firefox[valgrind]
    
     - no time was allocated to runtime-testing this, so more work may be required.
    
    Bug: https://bugs.gentoo.org/906509
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 profiles/base/package.use.mask | 5 +++++
 1 file changed, 5 insertions(+)
Comment 5 Joonas Niilola gentoo-dev 2023-06-06 19:23:48 UTC
After building with +valgrind and trying to start firefox, it segfaulted. I'm not sure if some of the src_configure logic went wrong, or if more parameters is needed to launch firefox after building with valgrind, OR if generally the used use flag combination resulted in a broken build. I can try this again in another time (need to do esr, thunderbird and spidermonkey first at least then focus on other projects)

For anyone willing to test, please unmask the use flag, try it out and report success! :)