]> git.proxmox.com Git - mirror_zfs.git/commit
Add `--enable-asan` and `--enable-ubsan` switches
authorDamian Szuberski <szuberskidamian@gmail.com>
Thu, 3 Feb 2022 22:35:38 +0000 (23:35 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 22:35:38 +0000 (14:35 -0800)
commit63652e154643cfe596fe077c13de0e7be34dd863
treea357fcff504f2b8fbdce59b236788435556b45f8
parentaa9905d89b3559e1cd280d018615d392f57a18d0
Add `--enable-asan` and `--enable-ubsan` switches

`configure` now accepts `--enable-asan` and `--enable-ubsan` switches
which results in passing `-fsanitize=address`
and `-fsanitize=undefined`, respectively, to the compiler. Those
flags are enabled in GitHub workflows for ZTS and zloop. Errors
reported by both instrumentations are corrected, except for:

- Memory leak reporting is (temporarily) suppressed. The cost of
  fixing them is relatively high compared to the gains.

- Checksum computing functions in `module/zcommon/zfs_fletcher*`
  have UBSan errors suppressed. It is completely impractical
  to enforce 64-byte payload alignment there due to performance
  impact.

- There's no ASan heap poisoning in `module/zstd/lib/zstd.c`. A custom
  memory allocator is used there rendering that measure
  unfeasible.

- Memory leaks detection has to be suppressed for `cmd/zvol_id`.
  `zvol_id` is run by udev with the help of `ptrace(2)`. Tracing is
  incompatible with memory leaks detection.

Reviewed-by: Ahelenia ZiemiaƄska <nabijaczleweli@nabijaczleweli.xyz>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #12928
50 files changed:
.github/workflows/zfs-tests-functional.yml
.github/workflows/zfs-tests-sanity.yml
.github/workflows/zloop.yml
cmd/zdb/zdb.c
cmd/zfs/zfs_main.c
cmd/zpool/zpool_main.c
cmd/ztest/ztest.c
cmd/zvol_id/zvol_id_main.c
config/Rules.am
config/Substfiles.am
config/always-compiler-options.m4
config/zfs-build.m4
include/zfs_fletcher.h
lib/libnvpair/libnvpair.abi
lib/libspl/assert.c
lib/libspl/include/assert.h
lib/libuutil/libuutil.abi
lib/libuutil/uu_pname.c
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_mount.c
lib/libzfs/libzfs_sendrecv.c
lib/libzfs_core/libzfs_core.abi
module/icp/algs/modes/gcm.c
module/icp/io/sha2_mod.c
module/zcommon/zfs_fletcher.c
module/zcommon/zfs_fletcher_aarch64_neon.c
module/zcommon/zfs_fletcher_avx512.c
module/zcommon/zfs_fletcher_intel.c
module/zcommon/zfs_fletcher_sse.c
module/zcommon/zfs_fletcher_superscalar.c
module/zcommon/zfs_fletcher_superscalar4.c
module/zfs/btree.c
module/zfs/vdev.c
module/zstd/lib/zstd.c
module/zstd/zfs_zstd.c
rpm/generic/zfs.spec.in
scripts/zfs-tests.sh
scripts/zloop.sh
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/include/default.cfg.in
tests/zfs-tests/tests/functional/alloc_class/alloc_class_013_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs/zfs_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_start_and_cancel_pos.ksh
tests/zfs-tests/tests/functional/pam/pam_basic.ksh
tests/zfs-tests/tests/functional/pam/pam_nounmount.ksh
tests/zfs-tests/tests/functional/pam/pam_short_password.ksh
tests/zfs-tests/tests/functional/pyzfs/pyzfs_unittest.ksh.in
tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c