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

Previous Next

Package: grep;

Reported by: Shlomi Fish <shlomif <at> shlomifish.org>

Date: Thu, 23 Oct 2014 11:16:02 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: Jim Meyering <jim <at> meyering.net>
To: 18806 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>,  Shlomi Fish <shlomif <at> shlomifish.org>
Cc: 18806-done <at> debbugs.gnu.org, Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Subject: bug#18806: grep -rP getline crashes prematurely (without displaying all results) on invalid UTF-8 input with LC_ALL=en_US.UTF-8
Date: Sat, 25 Oct 2014 11:06:51 -0700
On Fri, Oct 24, 2014 at 1:38 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Thanks for looking into this.  I added that test case, but took a
> more-conservative approach to fixing the bug, by disabling the optimization
> that's causing this problem; please see attached patches.  The optimization
> was a hack anyway, and these bugs suggest that it's not a hack worth
> keeping.

Hi Paul,
At first I thought "ok, either way."  But then I found that after your change,
our pcre-invalid-utf8-input hangs. That happens because the following
infloops (stuck in pcre_exec) on a CentOS6 system:

  printf 'j\202j\nj\nk\202\n' > in; LC_ALL=en_US.utf8 src/grep -P 'k$' in

That binary was linked with the libpcre from this package:

  pcre-7.8-4.el6.x86_64




This bug report was last modified 10 years and 209 days ago.

Previous Next


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