Skip to content

Instantly share code, notes, and snippets.

@arthuredelstein
Created July 13, 2017 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthuredelstein/a00899ad13fe7174a667ed9a39e3f1cf to your computer and use it in GitHub Desktop.
Save arthuredelstein/a00899ad13fe7174a667ed9a39e3f1cf to your computer and use it in GitHub Desktop.
Building DieHarder allocator on Debian

Here's what worked for me.

Building dieharder:

git clone --recursive https://github.com/emeryberger/DieHard
cd DieHard/src
make linux-gcc-x86-64 TARGET=libdieharder

Then I needed to add the following to my Firefox .mozconfig:

ac_add_options --disable-jemalloc
ac_add_options --disable-replace-malloc

The build was like this:

./mach clobber
./mach build

Then to use DieHarder as the allocator:

cd obj-x86_64-pc-linux-gnu/dist/bin
LD_PRELOAD=/home/arthur/DieHard/src/libdieharder.so ./firefox

I was able to use gdb to inspect stack traces and confirm that allocations were being done by libdieharder.so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment