GNU bug report logs - #73360
Error when a long list is provided to grep with "--binary-files=without-match" option

Previous Next

Package: grep;

Reported by: Rodrigo Jorge <rodrigoaraujorge <at> gmail.com>

Date: Thu, 19 Sep 2024 14:29:04 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: Paul Eggert <eggert <at> cs.ucla.edu>
To: Rodrigo Jorge <rodrigoaraujorge <at> gmail.com>, "David G. Pickett" <dgpickett <at> aol.com>
Cc: "73360 <at> debbugs.gnu.org" <73360 <at> debbugs.gnu.org>
Subject: bug#73360: Error when a long list is provided to grep with "--binary-files=without-match" option
Date: Fri, 20 Sep 2024 22:41:40 -0700
On 2024-09-20 07:22, Rodrigo Jorge wrote:
> Can I run those 2 grep commands with some sort of debug flag and send them
> back for analysis? The file list is exactly the same, just changing the
> file order.

Unfortunately there's no debug flag. Of course you can run grep under 
GDB but it will require some expertise to puzzle out why the last two 
files are treated differently.

Do you see the same problem if you run in the C locale? That is, set 
LC_ALL="C" in the environment.

What does 'strace' say about grep's reading of the two files in 
question? Can you give the strace output for just those two files?

I have the sneaking suspicion that the script is assuming properties of 
'grep' that are not documented and that are not guaranteed.  grep -I's 
heuristic for determining whether a file is "binary" is designed for 
that particular grep run, and does not necessarily agree with what other 
programs think are "binary files", or even what other instances of 
'grep' think are "binary files". The strace output might help clear up 
whether this is what is happening.




This bug report was last modified 298 days ago.

Previous Next


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