This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Do not leave files behind in /tmp from testing
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 15 Oct 2015 15:03:12 -0700 (PDT)
- Subject: Re: Do not leave files behind in /tmp from testing
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1510152049430 dot 6002 at digraph dot polyomino dot org dot uk> <20151015211437 dot 0A13E2C3C14 at topped-with-meat dot com> <alpine dot DEB dot 2 dot 10 dot 1510152117510 dot 6002 at digraph dot polyomino dot org dot uk> <20151015213704 dot C64FF2C3C14 at topped-with-meat dot com> <alpine dot DEB dot 2 dot 10 dot 1510152148060 dot 6002 at digraph dot polyomino dot org dot uk>
> On Thu, 15 Oct 2015, Roland McGrath wrote:
>
> > What I meant was that it's a regression in the parity of behavior between
> > normal and TEST_DIRECT cases. In the TEST_DIRECT case, there is no fork.
> > The only way that files get cleaned up is if they are in entered into the
> > temp_name_list in the PREPARE phase.
>
> I don't see why that would be the case.
Then apparently you have not noticed the point of the TEST_DIRECT case.
> delete_temp_files is called (only) via atexit - that applies whether or
> not there's a fork, and delete_temp_files should be called whether exit
> it called or the program returns from main (the case of calling _exit,
> and so not calling atexit handlers, doesn't apply to this test). It
> shouldn't matter at all which phase the files get entered into
> temp_name_list in.
If the test exits abnormally, then it won't call delete_temp_files at all.
In the normal case, the parent is there to catch the dying child and do
appropriate cleanup, so it matters that the parent's delete_temp_files
cover everything that the child's would have. (I acknowledge that this
matters less if it's not an EXPECTED_SIGNAL case, since /tmp turds left on
failures are less of a concern.) The TEST_DIRECT case is similar in
effect: the cleanup on abnormal exit is handled by the wrapper script,
which needs to be instructed between PREPARE and TEST_FUNCTION.