|
From: Pawel V. <paw...@gm...> - 2019-06-06 13:05:04
|
Hello! One of the ways that I'm using valgrind is in automated test suite, if any errors were reported by valgrind, the test is marked as failed. I recently added --track-fds to the set of options, to track unclosed files. I obviously had to make the test application close 0/1/2 at exit, so they are not reported. However, I also found that there was a file descriptor 3, which pointed to the valgrind log file, as was specified with the --log-file option. I had to make the application close pretty much all file descriptors with ID>2 in the beginning to have a proper test. I think that at the minimum, it'd be great if whatever file descriptors valgrind opened, were opened with O_CLOEXEC/FD_CLOEXEC, I think it can also be reasonable to not flag a situation as an error, if the descriptors that were left unclosed, were inherited. Since the application is not necessarily aware of such descriptors, and should not be held responsible for closing them. Thank you, Pawel. |