Bug 486488 - poor handling of invalid --log-fd
Summary: poor handling of invalid --log-fd
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.24 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-03 09:17 UTC by Oswald Buddenhagen
Modified: 2024-05-03 09:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Buddenhagen 2024-05-03 09:17:28 UTC
> $ valgrind --log-fd=13 /bin/echo
> ==3786620== Valgrind: failed to move log file descriptor into safe range, using stderr
> ==3786620== Memcheck, a memory error detector
> [...]
> ==3786620== Warning: invalid file descriptor 2 in syscall close()
> ==3786620==    Use --log-fd=<number> to select an alternative log fd.
> [...]

firstly, the error message is very unhelpful, as the root cause is that the source descriptor is invalid.

secondly, the message should be separated with an empty line from the blurb below, as otherwise it's way too easy to overlook.

lastly, these warning messages (there can be lots of them; the particular syscalls vary depending on the traced program) make no sense; apparently something doesn't get reset properly.