|
From: Tom H. <th...@cy...> - 2004-02-29 11:00:53
|
In message <Pin...@re...>
Nicholas Nethercote <nj...@ca...> wrote:
> On Sat, 28 Feb 2004, Tom Hughes wrote:
>
> > The fdleak_ failures are caused by the overnight tests being run from
> > cron and getting /dev/null as standard input which is explicitly left
> > alone by the filter script and hence the output doesn't match the
> > expected results which are designed for running from a terminal where
> > the terminal name would get filtered out.
>
> I understood that paragraph up to "standard input", but the rest lost me.
> How is the filter script interacting with /dev/null? How does the
> terminal name get filtered out? Sorry if I'm being dense.
The /dev/null was actually a red herring as standard input is
actually a pipe under cron it seems.
If you run the fdleak tests from an interactive session then the
output will include something like this:
==12551== Open file descriptor 2: /dev/pts/13
==12551== <inherited from parent>
==12551==
==12551== Open file descriptor 1: /dev/pts/13
==12551== <inherited from parent>
==12551==
==12551== Open file descriptor 0: /dev/pts/13
==12551== <inherited from parent>
which is then stripped to this:
==12551== Open file descriptor .: .
==12551== <inherited from parent>
==12551==
==12551== Open file descriptor .: .
==12551== <inherited from parent>
==12551==
==12551== Open file descriptor .: .
==12551== <inherited from parent>
So that the exact name of the terminal device doesn't effect whether
or not the test passes. Running from cron means that the standard input
output and error devices are pipes instead of terminals, which means
you get output like this:
==12509== Open file descriptor 2:
==12509== <inherited from parent>
==12509==
==12509== Open file descriptor 1:
==12509== <inherited from parent>
==12509==
==12509== Open file descriptor 0:
==12509== <inherited from parent>
Note that valgrind isn't able to work out what the descriptor is
because it's a pipe, so leaves that blank. That is then stripped
to this:
==12509== Open file descriptor .:
==12509== <inherited from parent>
==12509==
==12509== Open file descriptor .:
==12509== <inherited from parent>
==12509==
==12509== Open file descriptor .:
==12509== <inherited from parent>
Which doesn't match the results because of the final . being missing.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|