https://bugs.kde.org/show_bug.cgi?id=471222
Bug ID: 471222
Summary: support tracking of file descriptors being double
closed
Classification: Developer tools
Product: valgrind
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
valgrind already supports tracking file descriptors with --track-fds=yes.
This shows file descriptors that "leak", because they are never closed.
It would be really nice to extend this functionality to detecting double
closes.
For example in the following a file descriptor is (accidentally) closed twice:
#include <unistd.h>
int fd;
int main ()
{
fd = dup (1);
if (fd != -1)
close (fd);
/* ... */
close (fd);
return 0;
}
These might seem innocent at first. But it isn't in if between the two closes
(possibly in another thread) a new file descriptor is opened. Because that
might take the same number as the one closed and then it might be closed on the
second close.
--
You are receiving this mail because:
You are watching all bug changes.