Subject: bug#18806: grep -rP getline crashes prematurely (without displaying all results) on invalid UTF-8 input with LC_ALL=en_US.UTF-8

From: Shlomi Fish <[email-masked]>
Date: Fri, 24 Oct 2014 12:26:32 +0300

Hi Mr. Eggert,

On Thu, 23 Oct 2014 14:06:32 -0700
Paul Eggert <[email-masked]> wrote:

> On 10/23/2014 04:15 AM, Shlomi Fish wrote:
> > internal PCRE error: -32
> >
> > with the latest git grep.
> 
> I am not seeing a problem with that test case on my platform.  I am 
> running Fedora 20 x86-64, and compiled grep with GCC 4.9.1 (which I 
> built myself) and linked with the standard Fedora package 
> pcre-8.33-6.fc20.x86_64.  I also tried building with the Fedora GCC in 
> 32-bit mode, and couldn't reproduce the bug there either.
> 
> Possibly it's a libpcre problem?

I discovered a slightly different test case for it. Try running:

«
`which grep` --color -rP getline grep-test
»

From the command line. See this for a screenshot on Fedora:

* http://www.shlomifish.org/Files/files/images/gnu-grep-on-fedora.png

> 
> I tested with grep commit b2490802defe3c3bf7ef0036a4515d006a08a769 and 
> grep-bug-big5-utf8-from-IO-All commit 
> 9469e6e5be97d631c02bcfdbe814f43d1bb2df56.

I tested with grep commit b2490802defe3c3bf7ef0036a4515d006a08a769 .

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
http://www.shlomifish.org/humour/bits/facts/Summer-Glau/

Tomorrow never dies, unless Chuck Norris volunteers to take it out of its
misery.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .