Saruman
Saruman

Reputation: 153

Valgrind suppression and return code

It looks like valgrind returns non-zero return code when it detects memory-leak even though they are listed in the suppression file.

No-errors are displayed but yet the return code is 134. This fails all my builds in jenkins... Is there a way around this or am I doing something wrong?

Upvotes: 1

Views: 900

Answers (1)

phd
phd

Reputation: 3807

You are very probably doing something wrong (or maybe using a buggy old version of valgrind, the below is with the just released 3.12) :

valgrind --leak-check=full --errors-for-leak-kinds=all --error-exitcode=33
    --suppressions=t.supp ./memcheck/tests/trivialleak
...
==22750==         suppressed: 1,000 bytes in 1,000 blocks
...
echo $?
0

while without suppression file:

valgrind --leak-check=full --errors-for-leak-kinds=all --error-exitcode=33
    ./memcheck/tests/trivialleak
...
==22760== 1,000 bytes in 1,000 blocks are definitely lost in loss record 1 of 1
...
echo $?
33

Upvotes: 2

Related Questions