Subject: Re: [Bug-tar] Crash in gettext() after fork() on Mac OS X
From: Paul Eggert <[email-masked]>
To: [email-masked], [email-masked]
Date: Sun, 24 Nov 2013 16:10:16 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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.