GNU bug report logs - #44351
Bug in grep v3.2 onwards in regular expression matching

Previous Next

Package: grep;

Reported by: Gonzalo Padrino <grimalg.on+gnu <at> gmail.com>

Date: Sat, 31 Oct 2020 16:17:02 UTC

Severity: normal

Merged with 44352

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Gonzalo Padrino <grimalgon <at> gmail.com>
Subject: bug#44352: closed (Re: bug#44351: Bug in grep v3.2 onwards in
 regular expression matching)
Date: Sun, 01 Nov 2020 18:04:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#44351: Incorrect matches for some ERE

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 44352 <at> debbugs.gnu.org.

-- 
44351: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44351
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>, Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 44351-done <at> debbugs.gnu.org, Gonzalo Padrino <grimalg.on+gnu <at> gmail.com>
Subject: Re: bug#44351: Bug in grep v3.2 onwards in regular expression matching
Date: Sun, 1 Nov 2020 10:03:37 -0800
Thanks to all for the bug report and quick fix. Closing the bug report.

[Message part 3 (message/rfc822, inline)]
From: Gonzalo Padrino <grimalgon <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: Incorrect matches for some ERE
Date: Sat, 31 Oct 2020 16:26:25 +0100
[Message part 4 (text/plain, inline)]
  While using GNU grep v3.4 in an Ubuntu 20.04 userspace running on top of
Win10 WSL (yeah, i know... but also checked in other envs) i discovered
what seems like an obvious bug (if i'm not mistaken).

  The bug:
-----
me <at> host:~$  echo 'xxxxy' |grep -E '^x+x+x+x+y$'
xxxxy
me <at> host:~$  echo 'xxxy' |grep -E '^x+x+x+x+y$'
xxxy
me <at> host:~$  echo 'xxy' |grep -E '^x+x+x+x+y$'
xxy
me <at> host:~$  echo 'xy' |grep -E '^x+x+x+x+y$'

----
...the terminal supports ansi color escapes, and what's really weird is
that only the result from the first command is colored in red. First and
fourth commands yield correct results; the second and third do not, as they
should not match it's input.

  I've tested releases from v3.1 to latest v3.5 and found the anomalous
behaviour in version v3.2 through v3.5. A (quick and clunky) git bisect led
me to believe it was introduced about two years ago, possibly in commit
123620af88f55c3e0cc9f0aed7311c72f625bc82 (
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=123620af88f55c3e0cc9f0aed7311c72f625bc82
).
If this is true, it would mean either the bug is in gnulib, or maybe grep
needed to do some kind of extra handling on it's side.

Kind regards. Gonzalo Padrino.

P.S.: I had to patch some things in order to successfully compile the code
after checking out some problematic commits (pragmas to avoid warnings
about "pure" and "noreturn" function attributes, a missing configmake
dependency in bootstrap.conf, etc ).

P.S.: Resending message since first got lost in aether apparently.
[Message part 5 (text/html, inline)]

This bug report was last modified 4 years and 259 days ago.

Previous Next


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