Bug 185507 - Disable gigacage under valgrind
Summary: Disable gigacage under valgrind
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: bmalloc (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Trivial
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-10 00:27 PDT by Christian Hergert
Modified: 2018-05-10 07:20 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hergert 2018-05-10 00:27:05 PDT
It would be nice if webkit would auto-disable gigacage when it detects that valgrind is running. Otherwise, everyone who uses libwebkit2gtk-4.0 has to track down how to disable it with GIGACAGE_ENABLED=0 to use valgrind.
Comment 1 Adrian Perez 2018-05-10 02:01:47 PDT
The easy way to go about this would be detecting whether <valgrind.h>
is available, and use the “RUNNING_ON_VALGRIND” macro defined by it:

  http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq

Note that it expands to inline assembler in the architectures supported
by Valgrind, so it would be a build-time dependency only. It would be
nicer to not need Valgrind for building, but other alternative I see
around is checking “/proc/self/smaps” and grep for the name of the
Valgrind shared library which gets LD_PRELOAD'ed and that looks flimsy
to me.