Blame SOURCES/0101-tests-redirect-ASAN-reports-on-journald-to-a-file.patch

a3e2b5
From d0d284178c1ceb2bd13c9b501008c4458a58fe37 Mon Sep 17 00:00:00 2001
a3e2b5
From: Evgeny Vereshchagin <evvers@ya.ru>
a3e2b5
Date: Tue, 3 Jul 2018 19:29:42 +0000
a3e2b5
Subject: [PATCH] tests: redirect ASAN reports on journald to a file
a3e2b5
a3e2b5
Otherwise, they will end up in /dev/null.
a3e2b5
a3e2b5
(cherry picked from commit 88ed0f261ba8164a689395ddee8b92d00e073515)
a3e2b5
---
a3e2b5
 test/test-functions | 6 ++++++
a3e2b5
 1 file changed, 6 insertions(+)
a3e2b5
a3e2b5
diff --git a/test/test-functions b/test/test-functions
a3e2b5
index a6f88e4545..822136913b 100644
a3e2b5
--- a/test/test-functions
a3e2b5
+++ b/test/test-functions
a3e2b5
@@ -343,6 +343,12 @@ echo DefaultEnvironment=\$DEFAULT_ENVIRONMENT >>/etc/systemd/system.conf
a3e2b5
 # ASAN and syscall filters aren't compatible with each other.
a3e2b5
 find / -name '*.service' -type f | xargs sed -i 's/^\\(MemoryDeny\\|SystemCall\\)/#\\1/'
a3e2b5
 
a3e2b5
+# The redirection of ASAN reports to a file prevents them from ending up in /dev/null.
a3e2b5
+# But, apparently, sometimes it doesn't work: https://github.com/google/sanitizers/issues/886.
a3e2b5
+JOURNALD_CONF_DIR=/etc/systemd/system/systemd-journald.service.d
a3e2b5
+mkdir -p "\$JOURNALD_CONF_DIR"
a3e2b5
+printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log\n" >"\$JOURNALD_CONF_DIR/env.conf"
a3e2b5
+
a3e2b5
 export ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd.asan.log
a3e2b5
 exec  $ROOTLIBDIR/systemd "\$@"
a3e2b5
 EOF