Skip to content

Commit f8f2b77

Browse files
committed
fix suppr
1 parent 6339555 commit f8f2b77

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/suppr.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,19 @@ leak:libpaddle_inference
33
leak:xla::
44
leak:mlir::
55
leak:llvm::
6+
# PyTorch runtime — pybind11 bindings, op registration, tensor allocation, etc.
7+
leak:pybind11::
8+
leak:torch::
9+
leak:at::detail::
10+
# Python runtime — arena allocator, type system, module loader, string interning
11+
leak:_PyObject_Malloc
12+
leak:_PyMem_RawMalloc
13+
leak:PyMem_Malloc
14+
leak:PyMem_RawMalloc
15+
leak:_PyRuntime
16+
leak:_PyEval
17+
leak:_PyImport_LoadDynamicModuleWithSpec
18+
leak:find_name_in_mro
19+
leak:strdup
20+
# System libraries
21+
leak:libcrypto

source/install/test_cc_local.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ _GEN_ENV=""
4242
if echo "${CXXFLAGS:-}" | grep -q fsanitize=leak; then
4343
_LSAN_LIB=$(gcc -print-file-name=liblsan.so 2>/dev/null || true)
4444
if [ -n "${_LSAN_LIB}" ] && [ -f "${_LSAN_LIB}" ]; then
45-
# Preload LSAN runtime so Python can dlopen the sanitized .so,
46-
# but disable leak detection — PyTorch/Python internals trigger
47-
# massive false-positive reports that abort the script.
48-
_GEN_ENV="LD_PRELOAD=${_LSAN_LIB} LSAN_OPTIONS=detect_leaks=0"
45+
# Preload LSAN runtime so Python can dlopen the sanitized .so.
46+
_GEN_ENV="LD_PRELOAD=${_LSAN_LIB}"
47+
# Point to the suppressions file when LSAN_OPTIONS is not already
48+
# set (i.e. running outside CI). In CI the workflow already sets
49+
# LSAN_OPTIONS with the same suppressions file.
50+
if [ -z "${LSAN_OPTIONS:-}" ]; then
51+
_SUPPR=${SCRIPT_PATH}/../../.github/workflows/suppr.txt
52+
if [ -f "${_SUPPR}" ]; then
53+
_GEN_ENV="${_GEN_ENV} LSAN_OPTIONS=suppressions=${_SUPPR}"
54+
fi
55+
fi
4956
fi
5057
fi
5158
env ${_GEN_ENV} python ${INFER_SCRIPT_PATH}/gen_sea.py

0 commit comments

Comments
 (0)