Home:ALL Converter>Leak/Address sanitizer in a shared library without LD_PRELOAD

Leak/Address sanitizer in a shared library without LD_PRELOAD

Ask Time:2019-10-22T21:19:09         Author:Błażej Czapp

Json Formatter

I'm looking to use Clang's leak/address sanitizer on my shared library, which is loaded from JVM or dotnet (Linux) at runtime, so I can't recompile the binary.

Using LD_PRELOAD makes for a very noisy output, a lot (presumably false positive?) leaks get reported from the JVM itself. The sanitizer outright crashes when LD_PRELOADing for dotnet.

Is there any way to statically link the sanitizer into the shared library (or dynamically without LD_PRELOAD)?

Author:Błażej Czapp,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58505246/leak-address-sanitizer-in-a-shared-library-without-ld-preload
yy