FreeBSD 9.0: Valgrind leaks memory

Chuck Swiger cswiger at mac.com
Fri Mar 16 17:10:30 UTC 2012


On Mar 16, 2012, at 9:52 AM, Dimitry Andric wrote:
> For some reason, since the original BSD 4.4 Lite Lib Sources, the stdio
> files are only flushed, not closed, at exit.  In practice, it will not
> matter much, as the kernel will cleanup any left-overs when the process
> dies.

File descriptors get shared between parent and child processes...just because a child process terminates doesn't necessarily mean that you want to close everything.

Well, if POSIX 2008's O_CLOEXEC becomes more popular, folks can control whether a descriptor gets inherited an open() time, rather than needing fcntl()'s FD_CLOEXEC and deal with possible race conditions (especially multithreaded programs)...

Regards,
-- 
-Chuck



More information about the freebsd-stable mailing list