Bug 1287074 - grep-2.20: fix grep -E '^a|a$'
grep-2.20: fix grep -E '^a|a$'
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grep (Show other bugs)
6.7
All Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Jaroslav Škarvada
Jan Kepler
:
Depends On:
Blocks: 1359261 1413029
  Show dependency treegraph
 
Reported: 2015-12-01 07:51 EST by Alexey Dobriyan
Modified: 2017-03-21 07:33 EDT (History)
4 users (show)

See Also:
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 07:33:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexey Dobriyan 2015-12-01 07:51:59 EST
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@kcn.ne.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@kcn.ne.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 08:14:53 EST
Thanks for the report and commits.
Comment 10 errata-xmlrpc 2017-03-21 07:33:13 EDT
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

Note You need to log in before you can comment on or make changes to this bug.