[libvirt PATCH 0/6] Enable sanitizers

Tim Wiederhake twiederh at redhat.com
Mon May 3 10:01:40 UTC 2021

This series enables and adds AddressSanitizer and UndefinedBehaviorSanitizer
builds to the CI.

https://clang.llvm.org/docs/AddressSanitizer.html and

These sanitizers already found some issues in libvirt, e.g.
8b8c91f487592c6c067847ca59dde405ca17573f, or

There exist two more relevant sanitizers, ThreadSanitizer and MemorySanitizer.
Unfortunately, those two require an instrumented build of all dependencies,
including libc, to work correctly.

Note that clang and gcc have different implementations of these sanitizers,
hence the introduction of two new jobs to the CI. The latter one issues a
warning about the use of LD_PRELOAD in `virTestMain`, which in this
particular case can be safely ignored by setting `ASAN_OPTIONS` to
verify_asan_link_order=0` for the gcc build.


Tim Wiederhake (6):
  meson: Allow larger stack frames when instrumenting
  meson: Allow undefined symbols when sanitizers are enabled
  tests: virfilemock: realpath: Allow non-null second parameter
  tests: openvzutilstest: Remove duplicate linking with libvirt_openvz.a
  virt-aa-helper: Remove duplicate linking with src/datatypes.o
  ci: Enable address and undefined behavior sanitizers

 .gitlab-ci.yml            | 35 +++++++++++++++++++++++++++++++++++
 build-aux/syntax-check.mk |  2 +-
 meson.build               |  8 +++++++-
 src/libvirt_openvz.syms   |  2 ++
 src/security/meson.build  |  1 -
 tests/meson.build         |  2 +-
 tests/virfilemock.c       | 12 ++++++------
 7 files changed, 52 insertions(+), 10 deletions(-)


More information about the libvir-list mailing list