systemd/0242-test-set-ASAN_RT_PATH-along-with-LD_PRELOAD-to-the-A.patch
Jan Macku 0daf48d9aa systemd-250-8
Resolves: #2047682,#2068043,#2068131,#2073003,#2073994,#2082131,#2083493,#2087652,#2100340
2022-07-20 08:37:23 +02:00

31 lines
1.2 KiB
Diff

From 3a58ce9a0ff042f9d5e2c4b75462490a3868bd13 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Mon, 6 Jun 2022 14:45:11 +0200
Subject: [PATCH] test: set $ASAN_RT_PATH along with $LD_PRELOAD to the ASan
runtime DSO
Since we unset $LD_PRELOAD in the testsuite-* units (due to another
issue), let's store the path to the ASan DSO in another env variable, so
we can easily access it in the testsuite scripts when needed.
(cherry picked from commit 3ea18a2e36a5b8ac60c76e407f9dd38800455725)
Related: #2087652
---
test/test-functions | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test-functions b/test/test-functions
index 34aeac339f..a9ff561083 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -820,7 +820,7 @@ mount -o remount,rw /
# A lot of services (most notably dbus) won't start without preloading libasan
# See https://github.com/systemd/systemd/issues/5004
-DEFAULT_ENVIRONMENT="\$DEFAULT_ENVIRONMENT LD_PRELOAD=$ASAN_RT_PATH"
+DEFAULT_ENVIRONMENT="\$DEFAULT_ENVIRONMENT LD_PRELOAD=$ASAN_RT_PATH ASAN_RT_PATH=$ASAN_RT_PATH"
if [[ "$ASAN_COMPILER" == "clang" ]]; then
# Let's add the ASan DSO's path to the dynamic linker's cache. This is pretty