[PATCH] test: put shim at end of LD_PRELOAD path

Subject: [PATCH] test: put shim at end of LD_PRELOAD path

Date: Sat, 13 Mar 2021 08:43:37 -0400

To: notmuch@notmuchmail.org

Cc: David Bremner

From: David Bremner


Certain tools like the address-sanitizer fail if they are not the
first LD_PRELOADed library. It does not seem to matter for our shims,
as long as they are loaded before libnotmuch.
---

Using the address sanitizer with notmuch is still a manual process,
but this allows one to manually LD_PRELOAD libasan to make some more
tests pass.

 test/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 29baa0c1..89e218df 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1117,7 +1117,7 @@ notmuch_with_shim () {
     base_name="$1"
     shift
     shim_file="${base_name}.so"
-    LD_PRELOAD=./${shim_file}${LD_PRELOAD:+:$LD_PRELOAD} notmuch-shared "$@"
+    LD_PRELOAD=${LD_PRELOAD:+:$LD_PRELOAD}:./${shim_file} notmuch-shared "$@"
 }
 
 # Creates a script that counts how much time it is executed and calls
-- 
2.30.1
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: