[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#73360: Error when a long list is provided to grep with "--binary-fil
From: |
David G. Pickett |
Subject: |
bug#73360: Error when a long list is provided to grep with "--binary-files=without-match" option |
Date: |
Sat, 21 Sep 2024 19:13:03 +0000 (UTC) |
Linux strace (like Solaris truss) is a bit less confusing than gdb, and does
not need assistance from a symbol preserving compile option -g and lack of
strip. It can even start tracing running processes for which you have no
source code.
On Saturday, September 21, 2024 at 01:41:42 AM EDT, Paul Eggert
<eggert@cs.ucla.edu> wrote:
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.