GNU bug report logs - #15970
[Bug-tar] Crash in gettext() after fork() on Mac OS X

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 25 Nov 2013 00:11:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: bug#15970: closed (Re: bug#15970: [Bug-tar] Crash in gettext()
 after fork() on Mac OS X)
Date: Tue, 26 Nov 2013 12:24:05 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 15970 <at> debbugs.gnu.org.

-- 
15970: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15970
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: bug-tar <at> gnu.org, 15970-done <at> debbugs.gnu.org
Subject: Re: bug#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X
Date: Tue, 26 Nov 2013 12:23:15 +0000
[Message part 3 (text/plain, inline)]
On 11/26/2013 04:55 AM, Paul Eggert wrote:
> Pádraig Brady wrote:
> 
>> How about the attached instead that just uses
>> a somewhat degraded but simpler error() equivalent.
> 
> That looks safe, though it could be simplified:
> use inttostr instead of repeating its body,

Hah, I was thinking this must be done somewhere else :)

> and since !!p == !!errnum there's no need
> to have those duplicate conditions.

I meant to use (p || errstr), but let's assume
errstr is present, so yes we can then remove condition.

> Plus, just use STDERR_FILENO rather than
> fiddling with fileno (stderr),

done

> and async_safe_error
> should be _Noreturn and should unconditionally call
> _exit.

fair enough. I changed the name so to async_safe_die()

> And, I wouldn't bother looking at dup2's
> return value, any more than we look at close's.

Updated patch attached.

thanks!
Pádraig.

[sort-async-safe.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-tar <at> gnu.org, bug-coreutils <at> gnu.org
Subject: Re: [Bug-tar] Crash in gettext() after fork() on Mac OS X
Date: Sun, 24 Nov 2013 16:10:16 -0800
Eric Blake wrote:
> I bet coreutils' sort has a similar bug

[Adding bug-coreutils to the CC:.]

Coreutils 'sort' runs into this problem only
if dup2 fails when called from move_fd_or_die
or if execlp fails.

dup2 should never fail when it's called
the way that 'sort' calls it.  So perhaps
'sort' should be simplified to call dup2
and discard its return value.

And when execlp fails, 'sort' could _exit
with a special value, so that the parent
could report the failure.



This bug report was last modified 11 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.