Bug 1287074

Summary: grep-2.20: fix grep -E '^a|a$'
Product: Red Hat Enterprise Linux 6 Reporter: Alexey Dobriyan <adobriyan>
Component: grepAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.7CC: bnater, dominik.mierzejewski, jkejda, thozza
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: grep-2.20-6.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1413029 (view as bug list) Environment:
Last Closed: 2017-03-21 11:33:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1359261, 1413029    

Description Alexey Dobriyan 2015-12-01 12:51:59 UTC
Description of problem:

Upgrade to grep 2.20 in 6.7 brought the bug with match-at-the-start and match-at-the-end used in alteration. Responsible commit (shipped with grep 2.19) is

    commit 2c94326bd94a1ff46fe54cbd0596dd5d669d1b38
    Author: Norihiro Tanaka <noritnk.jp>
    Date:   Mon Mar 31 21:51:48 2014 +0900

        grep: speed-up for exact matching with begline and endline constraints.

The bug was accidentally fixed at 2.22 by

    commit 256a4b494fe1c48083ba73b4f62607234e4fefd5
    Author: Norihiro Tanaka <noritnk.jp>
    Date:   Mon Nov 17 08:26:53 2014 +0900

        dfa: speed up handling of long pattern

Please backport 256a4b494fe1c48083ba73b4f62607234e4fefd5 to RHEL6 or something.



Version-Release number of selected component (if applicable):
    every 2.19, 2.20, 2.21 based version, 
    grep-2.20-3.el6_7.1.src.rpm
    grep-2.20-1.el7.src.rpm



How reproducible:
100%


Steps to reproduce:

    $ echo -n 'abba' | /bin/grep -E '^b|b$'
    abba

Actual results:
bogus output
if match highlighting is on, nothing in output is highlighted

Expected results:
no output

Comment 2 Jaroslav Škarvada 2015-12-01 13:14:53 UTC
Thanks for the report and commits.

Comment 10 errata-xmlrpc 2017-03-21 11:33:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0756.html