Recently a peer and I discovered an interesting bug in GNU grep 2.5.1 in which standard input with lines greater than 200,000,000 characters causes grep to fail, even if the pattern is not in one of the long lines. If however grep reads the file with grep match file
it works fine. It appears this bug is fixed in 2.5.3.
cat big_file | grep pattern # this dies with an exit code 0 after encountering a long line
grep pattern big_file # works fine!
Does anyone know why this happens? Is the line limitation the true cause?