grep: sometimes mistakenly matches lines when last of multiple patterns includes backref

Bug #2007155 reported by Santiago Ruano Rincon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grep (Ubuntu)
New
Undecided
Unassigned

Bug Description

This bug was introduced upstream with grep 3.4. Originally reported in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029235#19

On an ubuntu focal machine:
  echo 'Total failed: 2 (1 ignored)' | grep -e '^Total failed: 0$' -e '^Total failed: \([0-9]*\) (\1 ignored)$'
  Total failed: 2 (1 ignored)

A fixed grep doesn't match the line.

This has been fixed in debian unstable with 3.8-4, and in bullseye with 3.6-1+deb11u1.

I've tested the attached patch in ubuntu focal (grep 3.4)

Tags: patch
Revision history for this message
Santiago Ruano Rincon (santiago-debian) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "1029235-grep-bug-backref-in-last-of-multiple-patterns.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.