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][BZ #12847] dprintf/vdprintf can cause fork to fail (child process crash)


On Sat, Sep 21, 2013 at 10:23:26PM +0200, OndÅej BÃlka wrote:
> On Sat, Sep 21, 2013 at 03:45:16PM -0400, Rich Felker wrote:
> > On Sat, Sep 21, 2013 at 09:13:46PM +0200, OndÅej BÃlka wrote:
> > > This bug has a simple patch from Frank Reker in bugzilla, see
> > > http://sourceware.org/bugzilla/show_bug.cgi?id=12847
> > > 
> > > Is it ok to commit or is cause somewhere else?
> > 
> > dprintf FILEs should not even *be* in this list. That is the
> > underlying bug.
> > 
> A code of dprintf looks similar to sprintf, we could mimic sprintf
> logic, however I do not have time to look into it now.

I don't object to your proposed fix as a quick band-aid, but I hope
the larger issue will be fixed. It's utterly stupid that dprintf
requires global locks to insert and remove a FILE in the list of open
FILEs every time you call it, despite there being no need for anything
else to be aware that this temporary FILE structure ever existed.

In principle, there's no good reason dprintf shouldn't be async-signal
safe, and it would be nice if it could eventually be so.

Rich


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