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: Florian Weimer <fw at deneb dot enyo dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 15 Oct 2015 23:06:44 +0200
- 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>
* Joseph Myers:
> I noticed that glibc testsuite runs left several files behind in /tmp
> (or TMPDIR, if different). The problem was testcases that generate a
> template for mkstemp / mkstemp64, ending with XXXXXX, then pass that
> template to add_temp_file before calling mkstemp / mkstemp64, meaning
> that the template ending with XXXXXX is stored in the list of
> temporary files to delete (add_temp_file uses strdup so that the
> original string doesn't need to stay live), not the actual filename as
> determined by mkstemp / mkstemp64. This patch fixes those tests to
> call add_temp_file later.
Oops, I think I broken this while fixing the memory leak in the test
driver.
> Tested for x86_64 (that the files are no longer left behind by a
> testsuite run and the modified tests still pass).
>
> 2015-10-15 Joseph Myers <joseph@codesourcery.com>
>
> * io/test-lfs.c (do_prepare): Do not call add_temp_file until
> after mkstemp64.
> * io/tst-fcntl.c (do_prepare): Do not call add_temp_file here.
> (do_test): Call add_temp_file here instead.
> * login/tst-utmp.c (do_prepare): Do not call add_temp_file until
> after mkstemp.
> * rt/tst-aio.c (do_prepare): Likewise.
> * rt/tst-aio64.c (do_prepare): Likewise.
Okay.
Thanks,
Florian