1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test: create a dummy LSan suppression file in the minimal image

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 f201f34477.
This commit is contained in:
Frantisek Sumsal 2021-11-26 16:21:51 +01:00
parent e6f48be8d4
commit 72f9e485ce

View 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"