diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-07-28 17:42:32 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-07-29 17:22:02 +0200 |
commit | c43da842fb26e74653e5456ff796b30947f1c6ff (patch) | |
tree | 88ebfd865f3750a9aa793bd0e8e7ee856a4cb45e /.ci | |
parent | 7670c7c2e1633351cfb6b168d5bb2589f1c132cb (diff) | |
download | openvswitch-c43da842fb26e74653e5456ff796b30947f1c6ff.tar.gz |
test-ovsdb: Fix false-positive leaks from LeakSanitizer.
LeakSanitizer for some reason reports these json objects as leaked,
even though we do have references to them at the moment ovs_fatal()
called from check_ovsdb_error().
Previously it complained only with -O2, but with newer versions of
clang/llvm it started complaining even with -O1. For example, negative
ovsdb parsing tests are failing on ubuntu 22.04 with clang 14 if built
with ASan and detect_leaks=1.
Fix that by destroying the json object before aborting the process.
And we may also build with default -O2 in CI with that change.
Alternative implementation might be to just pass the json to destroy
to every check_ovsdb_error() call, but indirect registering of the
pointer seems a bit less invasive.
Acked-by: Ales Musil <amusil@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to '.ci')
-rwxr-xr-x | .ci/linux-build.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 9746a8239..509314a07 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -252,15 +252,13 @@ fi if [ "$ASAN" ]; then # This will override default option configured in tests/atlocal.in. export ASAN_OPTIONS='detect_leaks=1' - # -O2 generates few false-positive memory leak reports in test-ovsdb - # application, so lowering optimizations to -O1 here. - CFLAGS_ASAN="-O1 -fno-omit-frame-pointer -fno-common -fsanitize=address" + CFLAGS_ASAN="-fno-omit-frame-pointer -fno-common -fsanitize=address" CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_ASAN}" fi if [ "$UBSAN" ]; then # Use the default options configured in tests/atlocal.in, in UBSAN_OPTIONS. - CFLAGS_UBSAN="-O1 -fno-omit-frame-pointer -fno-common -fsanitize=undefined" + CFLAGS_UBSAN="-fno-omit-frame-pointer -fno-common -fsanitize=undefined" CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}" fi |