Bug 459031 - Documentation of --error-exitcode is incomplete.
Summary: Documentation of --error-exitcode is incomplete.
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.18.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-12 19:26 UTC by David Anderson
Modified: 2022-09-17 21:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Anderson 2022-09-12 19:26:29 UTC
SUMMARY
***
Documentation on --error-exitcode incomplete
***


STEPS TO REPRODUCE
1.   valgrind --error-exitcode=1  /tmp/myprogram
2.   When myprogram exits with 1 determine if the failure
      was valgrind or the program.
3. 

Seen on Ubuntu 22.04 man page
and http://www.valgrind.org/docs/manual/index.html
ADDITIONAL INFORMATION

neither says anything explicitly about what exit code is returned
if valgrind does not find an error. AFAICT.

In my tests, it appears that when valgrind
finds no problem valgrind returns the exit code
of the application under test if --error-exitcode is set non-zero.
I suggest that the web page and man page should say that clearly.

in html version:
"Specifies an alternative exit code to return if Valgrind reported any errors in the run. 
When set to the default value (zero), the return value from Valgrind will always be the
 return value of the process being simulated. When set to a nonzero value, that value 
is returned instead, if Valgrind detects any errors. This is useful for using Valgrind as 
part of an automated test suite, since it makes it easy to detect test cases for which 
Valgrind has reported errors, just by inspecting return codes."

Which fails to clearly state that  " if Valgrind detects no errors the return code of the
process being simulated is returned by Valgrind".
Comment 1 Philippe Waroquiers 2022-09-17 21:13:33 UTC
Fixed in e489f3197