]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: redirect ASAN reports on journald to a file 9506/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Tue, 3 Jul 2018 19:29:42 +0000 (19:29 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Tue, 3 Jul 2018 19:50:49 +0000 (19:50 +0000)
Otherwise, they will end up in /dev/null.

test/test-functions

index 951b7e5a8983ca58701ca135e92a0952d1f13485..1b3d75210fac64bf99c067beefbc432606b4e733 100644 (file)
@@ -319,6 +319,12 @@ echo DefaultEnvironment=\$DEFAULT_ENVIRONMENT >>/etc/systemd/system.conf
 # ASAN and syscall filters aren't compatible with each other.
 find / -name '*.service' -type f | xargs sed -i 's/^\\(MemoryDeny\\|SystemCall\\)/#\\1/'
 
+# The redirection of ASAN reports to a file prevents them from ending up in /dev/null.
+# But, apparently, sometimes it doesn't work: https://github.com/google/sanitizers/issues/886.
+JOURNALD_CONF_DIR=/etc/systemd/system/systemd-journald.service.d
+mkdir -p "\$JOURNALD_CONF_DIR"
+printf "[Service]\nEnvironment=ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd-journald.asan.log\n" >"\$JOURNALD_CONF_DIR/env.conf"
+
 export ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS:log_path=/systemd.asan.log
 exec  $ROOTLIBDIR/systemd "\$@"
 EOF