GNU bug report logs - #25029
shuf generates “Bad file descriptor” error on nfs but only when run as a background process

Previous Next

Package: coreutils;

Reported by: Alex Ryan <alexander.j.ryan <at> gmail.com>

Date: Fri, 25 Nov 2016 22:25:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 25029 <at> debbugs.gnu.org
Cc: bug-gnulib <at> gnu.org, Alex Ryan <alexander.j.ryan <at> gmail.com>
Subject: bug#25029: shuf generates “Bad file descriptor” error on nfs but only when run as a background process
Date: Sun, 27 Nov 2016 00:18:23 +0000
On 26/11/16 23:49, Paul Eggert wrote:
> On 11/25/2016 06:00 PM, Paul Eggert wrote:
>> Isn't that a bug in glibc freopen? It shouldn't fail ... merely 
>> because stdin doesn't have a valid file descriptor. If so, we should 
>> fix the Gnulib freopen module to work around the bug.
> 
> I did that, by installing the attached patches into Gnulib (first patch) 
> and into Coreutils (2nd and 3rd patches). This fixes the shuf bug for 
> me, so closing the bug report. CC'ing to bug-gnulib due to the Gnulib fix.

Cool thanks.  I see it does the equivalent of:

  $tool file 0>&- || $tool file </dev/null

Does the freopen module now need to depend on
the dup2 and open modules?  For example using dup2(fd, fd)
to test fd validity fails on Linux 2.6.29

thanks,
Pádraig




This bug report was last modified 8 years and 236 days ago.

Previous Next


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