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.
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).
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.
(and thank you in advance!)
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(+)
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! :)