This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: _IO_vfscanf calling realloc
On Tue, May 15, 2012 at 8:58 AM, David Chappelle <chappedm@gmail.com> wrote:
> Hello,
>
> I am the maintainer of gperftools and have received a few issue
> submissions recently regarding deadlocks due to _IO_vfscanf calling
> realloc.
>
> http://code.google.com/p/gperftools/issues/detail?id=428
>
> This tells me that _IO_vfscanf in the past did not make a call to
> realloc since this deadlock would have surfaced many years ago. I am
> curious in which version GNU libc changed _IO_vfscanf to depend on
> realloc.
The problem was introduced here:
commit 3f8cc204fdd077da66ffc8e9595158b469e2b8e5
Author: Ulrich Drepper <drepper@gmail.com>
Date: Fri Sep 9 21:26:05 2011 -0400
Fix boundary conditions in scanf
Allocate large buffers with realloc. When returning error make sure
the stream is unlocked.
and fixed here:
commit 20b38e0301279a37a3f1e769843933bcc0d5f736
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Sun Jan 8 20:13:35 2012 -0500
sscanf always calls realloc
Hope this helps,
--
Paul Pluzhnikov