GNU bug report logs - #76291
BUG: grep sometimes spits out random garbage in the moddle of results

Previous Next

Package: grep;

Reported by: php fan <php4fan <at> gmail.com>

Date: Fri, 14 Feb 2025 17:01:02 UTC

Severity: normal

Full log


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

From: php fan <php4fan <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: BUG: grep sometimes spits out random garbage in the moddle of results
Date: Fri, 14 Feb 2025 17:28:35 +0100
I have no idea what triggers this, so I haven't been able to produce a
minimal reproducing example; and I can't share the actual folder with
which this happens to me all the time.

Sometimes I use "grep -R" on a folder with several repositories, and
after a few legitimate results, I get a blob of dozens of lines of
text, coming from several files, with no indication of the file they
belong to, and which often don't match the pattern.

For example:

```
$ grep -R foo
path/to/file1.txt: lorem ipsum foo bar
path/to/file2.txt: lalalalala foo lalalala
   and here's a blob of totally unrelated text
   that doen't contain the string
   who knows where this comes from
   lalalallaal lorem ipsum dolor sit amet
```

I am NOT talking about the case where you have a file that is one very
long line that matches, so you get basically the whole file in the
output and it gets wrapped. In that case, it will still start with the
path of the file followed by a colon. Not in this case.




This bug report was last modified 116 days ago.

Previous Next


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