GNU bug report logs - #20902
[BUG] hang at fifo despite of '-D skip'

Previous Next

Package: grep;

Reported by: Uwe Koloska <kolewu <at> koloro.de>

Date: Fri, 26 Jun 2015 15:15:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20902 in the body.
You can then email your comments to 20902 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#20902; Package grep. (Fri, 26 Jun 2015 15:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Uwe Koloska <kolewu <at> koloro.de>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 26 Jun 2015 15:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Uwe Koloska <kolewu <at> koloro.de>
To: bug-grep <at> gnu.org
Subject: [BUG] hang at fifo despite of '-D skip'
Date: Fri, 26 Jun 2015 11:40:29 +0200
Hello,

'grep -D skip' hangs when examining a FIFO.

This is a regression. It has been working since 2.5.2 (commit
5c7194f9e739082dc14f75769f2c19a39bb6cf84).
Debian 6.0.10 has 2.6.3 and there it's working, too. But 2.12 in debian
7.8 has the problem.  Don't know exactly when it changed.

The help (and manual) states:
  -D, --devices=ACTION      how to handle devices, FIFOs and sockets;
                            ACTION is 'read' or 'skip'

From this I expect, that grep will skip a FIFO and not block while
trying to handle it.

You can test for this error with this commands:

-8<-----------------------------------------------------
mkfifo myfifo
grep -D skip foo myfifo &
PID=$!
sleep 1
kill $PID 2>/dev/null && echo fail || echo ok
-8<-----------------------------------------------------

and here is the same idea as test for the test-suite:

#+FILE: tests/skip-fifo
-8<-----------------------------------------------------
#!/bin/sh
# grep must ignore a fifo when started with -D skip

. "${srcdir=.}/init.sh"; path_prepend_ ../src

mkfifo myfifo

grep -D skip foo myfifo &
PID=$!
# just to make sure
sleep 1
kill $PID && fail=1

# the other way round
grep foo myfifo &
PID=$!
# just to make sure
sleep 1
kill $PID || fail=1

Exit $fail
-8<-----------------------------------------------------

Best regards
Uwe Koloska




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 26 Jun 2015 23:52:02 GMT) Full text and rfc822 format available.

Notification sent to Uwe Koloska <kolewu <at> koloro.de>:
bug acknowledged by developer. (Fri, 26 Jun 2015 23:52:02 GMT) Full text and rfc822 format available.

Message #10 received at 20902-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Uwe Koloska <kolewu <at> koloro.de>
Cc: 20902-done <at> debbugs.gnu.org
Subject: Re:  [BUG] hang at fifo despite of '-D skip'
Date: Fri, 26 Jun 2015 16:50:52 -0700
[Message part 1 (text/plain, inline)]
Thanks for reporting this bug.  I installed the attached into the grep master on 
savannah, and it (or something like it) should appear in the next release.
[0001-grep-don-t-hang-on-command-line-fifo-if-D-skip.patch (text/x-diff, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#20902; Package grep. (Sat, 27 Jun 2015 17:48:01 GMT) Full text and rfc822 format available.

Message #13 received at 20902 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: 20902 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>, 
 Uwe Koloska <kolewu <at> koloro.de>
Cc: 20902-done <at> debbugs.gnu.org
Subject: Re: bug#20902: [BUG] hang at fifo despite of '-D skip'
Date: Sat, 27 Jun 2015 10:46:49 -0700
On Fri, Jun 26, 2015 at 4:50 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Thanks for reporting this bug.  I installed the attached into the grep
> master on savannah, and it (or something like it) should appear in the next
> release.

Nice!  Thank you both.




Information forwarded to bug-grep <at> gnu.org:
bug#20902; Package grep. (Sat, 27 Jun 2015 17:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Jul 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 330 days ago.

Previous Next


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