This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix memory leak in printf_positional


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]