2016-05-12 2 views
0

Pourquoi Valgrind a-t-il un code de sortie de 1, lorsque l'exécutable sous test se termine par 0?Pourquoi Valgrind a-t-il un code de sortie de 1, lorsque l'exécutable sous test se termine par 0?

$ ./test 
Starting tests... 
ALL TESTS PASSED 
Tests run: 1 

$ valgrind --error-exitcode=123 test 
==27705== Memcheck, a memory error detector 
==27705== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. 
==27705== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info 
==27705== Command: test 
==27705== 
==27705== 
==27705== HEAP SUMMARY: 
==27705==  in use at exit: 0 bytes in 0 blocks 
==27705== total heap usage: 30 allocs, 30 frees, 3,681 bytes allocated 
==27705== 
==27705== All heap blocks were freed -- no leaks are possible 
==27705== 
==27705== For counts of detected and suppressed errors, rerun with: -v 
==27705== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 
$ echo $? 
1 

Répondre

0

Cela fonctionne:

$ valgrind --error-exitcode=123 ./test 
==27764== Memcheck, a memory error detector 
==27764== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. 
==27764== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info 
==27764== Command: ./test 
==27764== 
Starting tests... 
ALL TESTS PASSED 
Tests run: 1 
==27764== 
==27764== HEAP SUMMARY: 
==27764==  in use at exit: 0 bytes in 0 blocks 
==27764== total heap usage: 0 allocs, 0 frees, 0 bytes allocated 
==27764== 
==27764== All heap blocks were freed -- no leaks are possible 
==27764== 
==27764== For counts of detected and suppressed errors, rerun with: -v 
==27764== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) 

2016-05-12T07:51:35Z [email protected]:~/vr2200-platform/pmu (master) 
$ echo $? 
0 

La cause était un exécutable sur le chemin aussi appelé "test", qui est revenu 1.