Skip to content

Commit 4984c45

Browse files
committed
valgrind memory leak check
1 parent 74ab5ac commit 4984c45

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ valgrind:
9999
--log-file=/tmp/valgrind-output \
100100
python3 -m pytest --no-memcheck -vv --valgrind --valgrind-log=/tmp/valgrind-output
101101

102+
.PHONY: valgrind-leak
103+
valgrind-leak:
104+
PYTHONMALLOC=malloc valgrind --suppressions=Tests/oss-fuzz/python.supp --leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite \
105+
--log-file=/tmp/valgrind-output \
106+
python3 -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output Tests/
107+
102108
.PHONY: readme
103109
readme:
104110
python3 -c "import markdown2" > /dev/null 2>&1 || python3 -m pip install markdown2

Tests/oss-fuzz/python.supp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@
1414
fun:_TIFFReadEncodedTileAndAllocBuffer
1515
...
1616
}
17+
18+
{
19+
<python_alloc_possible_leak>
20+
Memcheck:Leak
21+
match-leak-kinds: possible
22+
fun:malloc
23+
fun:_PyMem_RawMalloc
24+
fun:PyObject_Malloc
25+
...
26+
}
27+
28+
{
29+
<python_realloc_possible_leak>
30+
Memcheck:Leak
31+
match-leak-kinds: possible
32+
fun:malloc
33+
fun:_PyMem_RawRealloc
34+
fun:PyMem_Realloc
35+
...
36+
}

0 commit comments

Comments
 (0)