emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#25283: closed (grep: (standard input): invalid arg


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#25283: closed (grep: (standard input): invalid argument when run from make)
Date: Tue, 27 Dec 2016 19:24:01 +0000

Your message dated Tue, 27 Dec 2016 11:23:32 -0800
with message-id <address@hidden>
and subject line Re: bug#25283: grep: (standard input): invalid argument when 
run from make
has caused the debbugs.gnu.org bug report #25283,
regarding grep: (standard input): invalid argument when run from make
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
25283: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25283
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: grep: (standard input): invalid argument when run from make Date: Tue, 27 Dec 2016 18:14:27 +0000
The following Makefile illustrates the issue:

$ cat >Makefile <<EOF
all:
echo "abc" | grep "b"
.PHONY: all
$ make all # works as expected
$ make all > /dev/null
grep: (standard input): Invalid argument
make: *** [Makefile:2: all] Error 2

The bug was introduced by commit 4fa6f48b573267e758650e114ec158d97916411e (introducing the usage of splice), which was first released in grep version 2.27. 

My environment:

$ make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ grep --version
grep (GNU grep) 2.27
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.


Patch attached.

--
Benno Fünfstück

Attachment: fix-splice-einval.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#25283: grep: (standard input): invalid argument when run from make Date: Tue, 27 Dec 2016 11:23:32 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 Thanks for reporting that problem. I wonder why GNU 'make' sets stdout to append mode? That surprises me, and I don't see where POSIX allows it. Anyway, it's clearly a bug in 'grep' no matter what 'make' is doing. I wrote up a test case for the bug and installed the attached, which is a bit more conservative than the patch you submitted.

Attachment: 0001-grep-fix-bug-with-.-grep-pat-dev-null.txt
Description: Text document


--- End Message ---

reply via email to

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