2016-05-12 3 views
0

Warum hat Valgrind einen Exit-Code von 1, wenn die ausführbare Datei mit 0 endet?Warum hat Valgrind einen Exit-Code von 1, wenn die ausführbare Datei mit 0 endet?

$ ./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 

Antwort

0

Dies funktioniert:

$ 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 

Die Ursache eine ausführbare Datei auf dem Weg war auch "Test" genannt, die 1. zurück

Verwandte Themen