Skip to content

Commit

Permalink
Workaround ASAN bug ignoring RPATH (#5388)
Browse files Browse the repository at this point in the history
Signed-off-by: Joaquin Anton <[email protected]>
  • Loading branch information
jantonguirao authored Mar 25, 2024
1 parent 68aa46d commit bafab17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qa/test_template_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ enable_sanitizer() {
gcc -shared -fPIC $topdir/qa/test_wrapper_post.c -o /tmp/post.so
export OLD_LD_PRELOAD=${LD_PRELOAD}
export LD_PRELOAD="/tmp/pre.so /usr/lib/x86_64-linux-gnu/libasan.so /tmp/glibc_fix.so /tmp/post.so /usr/lib/x86_64-linux-gnu/libstdc++.so /tmp/libfakeclose.so"
# Workaround for bug in asan ignoring RPATHs https://bugzilla.redhat.com/show_bug.cgi?id=1449604
export OLD_LD_LIBRARY_PATH2=${LD_LIBRARY_PATH} # OLD_LD_LIBRARY_PATH variable name already used
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(python -c 'import nvidia.nvimgcodec as n; import os; print(os.path.dirname(n.__file__))')
}

# turn off sanitizer to avoid breaking any non-related system built-ins
disable_sanitizer() {
export ASAN_OPTIONS=start_deactivated=true:detect_leaks=0:detect_container_overflow=0
export LD_PRELOAD=${OLD_LD_PRELOAD}
export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH2}
unset ASAN_SYMBOLIZER_PATH
unset PYTHONMALLOC
}
Expand Down

0 comments on commit bafab17

Please sign in to comment.