Skip to content

Commit b06a390

Browse files
authored
Improve sanitizer configuration and suppress false positives (NVIDIA#5795)
- adds address.sup file to suppress heap-buffer-overflow reports from libapt-pkg - refactors sanitizer configuration in test_template_impl.sh: - moves suppressions configuration to top level - adds address sanitizer suppressions file to ASAN_OPTIONS Signed-off-by: Janusz Lisiecki <[email protected]>
1 parent c713ba5 commit b06a390

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

qa/address.sup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# apt started reporting heap-buffer-overflow
2+
interceptor_via_lib:libapt-pkg

qa/leak.sup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# external libraries
2+
23
leak:paddle
34
leak:llvm
45
leak:zmq

qa/test_template_impl.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ set -x
99
export PYTHONUNBUFFERED=1
1010

1111
topdir=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )/..
12+
# supress leaks that are false positive or not related to DALI
13+
export LSAN_OPTIONS=suppressions=$topdir/qa/leak.sup
14+
export ASAN_OPTIONS=start_deactivated=true:detect_leaks=0:detect_container_overflow=0:suppressions=$topdir/qa/address.sup
15+
1216
source $topdir/qa/setup_test_common.sh
1317

1418
# Set runner for python tests
@@ -68,9 +72,7 @@ epilog=${epilog-:}
6872
numer_of_prolog_elms=${#prolog[@]}
6973

7074
enable_sanitizer() {
71-
# supress leaks that are false positive or not related to DALI
72-
export LSAN_OPTIONS=suppressions=$topdir/qa/leak.sup
73-
export ASAN_OPTIONS=symbolize=1:protect_shadow_gap=0:log_path=sanitizer.log:start_deactivated=true:allocator_may_return_null=1:detect_leaks=1:fast_unwind_on_malloc=0:verify_asan_link_order=0:detect_container_overflow=0
75+
export ASAN_OPTIONS=symbolize=1:protect_shadow_gap=0:log_path=sanitizer.log:start_deactivated=true:allocator_may_return_null=1:detect_leaks=1:fast_unwind_on_malloc=0:verify_asan_link_order=0:detect_container_overflow=0:suppressions=$topdir/qa/address.sup
7476
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
7577
# avoid python false positives
7678
export PYTHONMALLOC=malloc
@@ -91,7 +93,7 @@ enable_sanitizer() {
9193

9294
# turn off sanitizer to avoid breaking any non-related system built-ins
9395
disable_sanitizer() {
94-
export ASAN_OPTIONS=start_deactivated=true:detect_leaks=0:detect_container_overflow=0
96+
export ASAN_OPTIONS=start_deactivated=true:detect_leaks=0:detect_container_overflow=0:suppressions=$topdir/qa/address.sup
9597
export LD_PRELOAD=${OLD_LD_PRELOAD}
9698
export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH2}
9799
unset ASAN_SYMBOLIZER_PATH

0 commit comments

Comments
 (0)