This is the mail archive of the 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 Fri, Aug 28, 2015 at 6:59 AM, Carlos O'Donell <> wrote:
> On 08/28/2015 09:55 AM, Joseph Myers wrote:
>> On Thu, 27 Aug 2015, Carlos O'Donell wrote:
>>> 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,
>> I really don't think this case should take that long to find how to
>> trigger the leak.

It doesn't take very long: all I needed is a printf invocation with >=
65536 / 3 / sizeof(void*) arguments.

Writing such invocation by hand is of course toublesome, plumbing
Makefile to generate it for me, and figuring out why it doesn't work
is what takes time :-(

In addition, there is a GCC regression: compiling a printf call with
2800 arguments takes 4.8.4-2ubuntu1~14.04 0.06s without optimization,
0.86s with -O2. Same numbers for current GCC trunk (@r227321): 0.06s
and  4m46s. This is on a very recent and fast PC. I expect there could
be PCs in current use where the time will be 3x longer.

Are we willing to tolerate such long compile times for a test case?
If so, I'll send a combined patch.

Paul Pluzhnikov

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