[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined behavior in closeout, aggravated by libsigsegv

From: Eric Blake
Subject: Re: undefined behavior in closeout, aggravated by libsigsegv
Date: Sat, 18 Jul 2009 07:17:37 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090605 Thunderbird/ Mnenhy/

Hash: SHA1

According to Jim Meyering on 7/18/2009 6:48 AM:
>> it (although with #if _LIBC guards to make upstream adoption easier).
>> How about this patch?  It was enough to fix the behavior of m4 on cygwin
> I have a slight preference for omitting the #if !_LIBC guards,
> and thus adopting the improvement unconditionally whenever error.c is used.
> The added fcntl call has minimal cost (at least that's my recollection
> from back when I measured it), and in the unusual case of already-closed
> stdout, there will be no failing close syscall to distract readers of
> strace output logs.

The #if !_LIBC code is guarding a new fcntl syscall, but there is nothing
in my patch that reduces the number of close syscalls (rather, it is a
matter of avoiding fflush, which already has no syscalls on glibc if there
is nothing to do).  I don't see any reason to remove the guard, unless the
glibc maintainers think otherwise.  At any rate, I've also created the
glibc bug report: http://sources.redhat.com/bugzilla/show_bug.cgi?id=10412

> But either way is fine.

I pushed my patch as-is to gnulib.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]