GNU bug report logs - #25655
grep-2.28 is broken with multiple -e patterns

Previous Next

Package: grep;

Reported by: Lars Wendler <polynomial-c <at> gentoo.org>

Date: Wed, 8 Feb 2017 19:53:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25655 in the body.
You can then email your comments to 25655 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#25655; Package grep. (Wed, 08 Feb 2017 19:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Wendler <polynomial-c <at> gentoo.org>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Wed, 08 Feb 2017 19:53:01 GMT) Full text and rfc822 format available.

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

From: Lars Wendler <polynomial-c <at> gentoo.org>
To: bug-grep <at> gnu.org
Cc: base-system <at> gentoo.org
Subject: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 20:49:35 +0100
[Message part 1 (text/plain, inline)]
Hi,

we got a bug report a Gentoo [1] that grep-2.28 is broken when
searching for multiple patterns with -e:

grep-2.27:

  % echo ".tar" | grep -e "\.tar"; echo $?           
  .tar
  0

  % echo ".tar" | grep -e "\.tar" -e "\.tbz"; echo $?
  .tar
  0


grep-2.28:

   % echo ".tar" | grep -e "\.tar"; echo $?           
   .tar
   0

   % echo ".tar" | grep -e "\.tar" -e "\.tbz"; echo $?
   1


But this seems to be not the only issue:


echo "atbz" | grep -e "\.tar" -e ".tbz"

is matching "atbz"

echo ".tbz" | grep -e "\.tar" -e ".tbz"

matches ".tbz"

but

echo ".tar" | grep -e "\.tar" -e "tar"

only matches "ta".


We've identified commit 290ca116c9172d97b2b026951fac722d3bd3ced9 as the
one that introduced this regression

Kind regards
Lars

[1] https://bugs.gentoo.org/608644

-- 
Lars Wendler
Gentoo package maintainer
GPG: 21CC CF02 4586 0A07 ED93  9F68 498F E765 960E 9B39

Attention! New gpg key! See
https://www.gentoofan.org/blog/index.php?/archives/9-New-gpg-keys.html
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 08 Feb 2017 21:05:02 GMT) Full text and rfc822 format available.

Notification sent to Lars Wendler <polynomial-c <at> gentoo.org>:
bug acknowledged by developer. (Wed, 08 Feb 2017 21:05:02 GMT) Full text and rfc822 format available.

Message #10 received at 25655-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Wendler <polynomial-c <at> gentoo.org>, 25655-done <at> debbugs.gnu.org
Cc: base-system <at> gentoo.org
Subject: Re: bug#25655: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 13:04:25 -0800
[Message part 1 (text/plain, inline)]
Thanks for reporting that. It's a reasonably serious bug. I installed 
the attached patch to fix it.
[0001-grep-do-not-mishandle-.-in-multiple-patterns.patch (application/x-patch, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#25655; Package grep. (Wed, 08 Feb 2017 21:33:02 GMT) Full text and rfc822 format available.

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

From: Bruce Dubbs <bruce.dubbs <at> gmail.com>
To: 25655 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, polynomial-c <at> gentoo.org
Subject: Re: bug#25655: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 15:32:45 -0600
Paul Eggert wrote:
> Thanks for reporting that. It's a reasonably serious bug. I installed the
> attached patch to fix it.

Thanks for the patch.  Are you going to consider releasing 2.28.1 soon? 
LFS is going into a package freeze in a few days and we would prefer a new 
version to a patch.

  -- Bruce
     linuxfromscratch.org




Information forwarded to bug-grep <at> gnu.org:
bug#25655; Package grep. (Wed, 08 Feb 2017 21:44:02 GMT) Full text and rfc822 format available.

Message #16 received at 25655-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Bruce Dubbs <bruce.dubbs <at> gmail.com>
Cc: polynomial-c <at> gentoo.org, 25655-done <at> debbugs.gnu.org,
 Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#25655: grep-2.28 is broken with multiple -e patterns
Date: Wed, 8 Feb 2017 13:42:47 -0800
On Wed, Feb 8, 2017 at 1:32 PM, Bruce Dubbs <bruce.dubbs <at> gmail.com> wrote:
> Paul Eggert wrote:
>>
>> Thanks for reporting that. It's a reasonably serious bug. I installed the
>> attached patch to fix it.

Thanks for the quick fix, indeed.

> Thanks for the patch.  Are you going to consider releasing 2.28.1 soon? LFS
> is going into a package freeze in a few days and we would prefer a new
> version to a patch.

I will make a new release very soon.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Mar 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 20 days ago.

Previous Next


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