]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: create a dummy LSan suppression file in the minimal image
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Nov 2021 15:21:51 +0000 (16:21 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 26 Nov 2021 18:15:51 +0000 (18:15 +0000)
otherwise gcc's ASan complains (unlike clang's) when the image is used -
e.g. in TEST-29 or TEST-50.

```
[   17.328705] testsuite-29.sh[361]: + portablectl --profile=trusted attach --now --runtime /usr/share/minimal_0.raw app0
...
[   20.978649] systemd[1]: Starting app0-foo.service...
[   21.104844] kernel: loop0: detected capacity change from 0 to 24960
[   20.999559] systemd[1]: Starting app0.service...
[   21.126022] kernel: loop1: detected capacity change from 0 to 24960
...
[   21.861087] cat[422]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.868634] cat[421]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.877941] systemd[1]: app0.service: Control process exited, code=exited, status=1/FAILURE
[   21.878836] systemd[1]: app0.service: Failed with result 'exit-code'.
[   21.905712] systemd[1]: Failed to start app0.service.
```

Follow-up to f201f3447796a5424372d32b338bc3b907516c28.

test/test-functions

index 0a3745de529828560d98b4441958c0b718302c2f..d8b549a1dc8d2581efbbbacbd9957ae1f23afcd1 100644 (file)
@@ -588,6 +588,10 @@ install_verity_minimal() {
             # missing $LD_PRELOAD libraries.
             inst_libs "$ASAN_RT_PATH"
             inst_library "$ASAN_RT_PATH"
+            # Create a dummy LSan suppression file otherwise gcc's ASan
+            # complains as it doesn't exist in the minimal image
+            # (i.e. when running TEST-29 or TEST-50 under sanitizers)
+            touch "$initdir/systemd-lsan.supp"
         fi
         cp "$os_release" "$initdir/usr/lib/os-release"
         ln -s ../usr/lib/os-release "$initdir/etc/os-release"