From 32fbd59f85104770b8fcc03fed5fb9f2398f0733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 25 Sep 2018 22:37:06 +0300 Subject: [PATCH] Add ASAN options into systemd service files By default ASAN only reports the errors and doesn't cause the program to crash. By forcing a SIGABRT, the process will generate a core dump which causes the test to fail. Although the act of placing environment variables inside the systemd service file might seem intrusive, they have no effect on non-ASAN builds. This appears to be the most convenient and straightforward way of changing ASAN behavior for testing. --- etc/maxscale.service.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/maxscale.service.in b/etc/maxscale.service.in index 9b1c1299e..bc2c94838 100644 --- a/etc/maxscale.service.in +++ b/etc/maxscale.service.in @@ -21,5 +21,8 @@ TimeoutStartSec=120 LimitNOFILE=65535 StartLimitBurst=0 +# Only relevant when MaxScale is linked with -fsanitize=address +Environment=ASAN_OPTIONS=abort_on_error=1 + [Install] WantedBy=multi-user.target