This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix memory leak in printf_positional
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 27 Aug 2015 21:22:15 -0400
- Subject: Re: [PATCH] Fix memory leak in printf_positional
- Authentication-results: sourceware.org; auth=none
- References: <1440571295-20230-1-git-send-email-eggert at cs dot ucla dot edu> <alpine dot DEB dot 2 dot 10 dot 1508260930500 dot 26898 at digraph dot polyomino dot org dot uk>
On 08/26/2015 05:34 AM, Joseph Myers wrote:
> For memory leak bugs, if possible we add testcases to the testsuite that
> use mtrace. That means (in addition to listing the test in tests as
> usual) adding $(objpfx)<test>-mem.out to tests-special, setting <test>-ENV
> to set MALLOC_TRACE, and adding the makefile rule that calls mtrace; see
> various existing examples. (Of course the test should be something
> verified to fail the mtrace tests before the leak fix is applied;
> presumably it isn't hard to construct such a case that uses the malloc
> path here, and there might even be an existing test that could just have
> the pieces to use mtrace added to it.)
To repeat what I said in the bugzilla, which I should have just said here.
I agree, but I don't think anyone should spend more than an hour trying
to find such a test case. The static analysis tools can show you a failure,
but actually triggering that failure involves getting coverage over that
line of code, which isn't always trivial. We won't know until we try,
but I'd like anyone looking at the coverity results to be practical
about how possible it is to write a test case to cover the detected
failure.
Cheers,
Carlos.