]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
readme: clarify that LD_PRELOAD is not needed for ASAN
authorCaleb Sander <csander@purestorage.com>
Fri, 13 Oct 2023 23:41:30 +0000 (17:41 -0600)
committerDaniel Wagner <wagi@monom.org>
Thu, 2 Nov 2023 13:31:26 +0000 (14:31 +0100)
The README currently suggests setting LD_PRELOAD to the libasan path.
However, this seems to be unnecessary (at least on my gcc 9 setup).
The test executables request to link with libasan.so (before libc.so),
so it is automatically loaded.
The recommended suggestion also ends up running ninja with ASAN
instrumentation, which causes it to fail with leaks detected.

Signed-off-by: Caleb Sander <csander@purestorage.com>
README.md

index c493ef77cfa4aee9e0c10048babbe247b5c6420f..f785d0c241cc47d1e62263f11ea3be0ac7437228 100644 (file)
--- a/README.md
+++ b/README.md
@@ -171,7 +171,9 @@ To enable address sanitizer (advanced debugging of memory issues):
 meson setup .build -Db_sanitize=address
 ```
 
-This option adds `-fsanitize=address` to the gcc options. Note that when using the sanitize feature, the library `libasan.so` must be available and must be the very first library loaded when running an executable. Ensuring that `libasan.so` gets loaded first can be achieved with the `LD_PRELOAD` environment variable as follows: 
+This option adds `-fsanitize=address` to the gcc options. The tests can then be run normally (`meson test -C .build`).
+
+Note that when using the sanitize feature, the library `libasan.so` must be available and must be the very first library loaded when running an executable. If experiencing linking issues, you can ensure that `libasan.so` gets loaded first with the `LD_PRELOAD` environment variable as follows:
 
 ```
 meson setup .build -Db_sanitize=address && LD_PRELOAD=/lib64/libasan.so.6 ninja -C .build test