]> git.ipfire.org Git - thirdparty/util-linux.git/commit
ci: deal with uninstrumented binaries using instrumented libs
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 29 Jan 2021 21:01:02 +0000 (22:01 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 1 Feb 2021 11:00:30 +0000 (12:00 +0100)
commit81edf9f0da682b8e39f20633f4d6a3e1ebabf61f
tree870c13ebac165c2943a191c09ac23cc67a7cf92f
parentc40b3cd03d963286f0f21f3299bd33b7ceaea3b1
ci: deal with uninstrumented binaries using instrumented libs

All `eject` tests were failing under ASan, since they call /bin/mount,
which is uninstrumented, but it picks up the instrumented `libblkid`
library, causing ASan to complain:

gcc:
ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed

clang:
/bin/umount: symbol lookup error: /home/runner/work/util-linux/util-linux/.libs/libblkid.so.1: undefined symbol: __sancov_lowest_stack
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed

Subsequently, all tests which require the `scsi_debug` module get skipped,
since it's still in use due to the failed umount:

fdisk: align 512/4K                   ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +alignment_offset ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +MD               ... SKIPPED (cannot remove scsi_debug module (rmmod))

In case of gcc this can be easily resolved by setting $LD_PRELOAD to the
respective ASan library. clang makes this a bit more difficult, since it
compiles the ASan library statically, so firstly we need to force dynamic
linking (via -shared-asan), and then add the runtime DSO path to the
linker cache, since it's in a non-standard path.
.github/workflows/cibuild.sh
libfdisk/src/Makemodule.am
libmount/src/Makemodule.am
login-utils/Makemodule.am
tests/functions.sh
tests/ts/eject/umount
tests/ts/fuzzers/test_fdisk_script_fuzz
tests/ts/fuzzers/test_last_fuzz
tests/ts/fuzzers/test_mount_fuzz