RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1167766 - grep Abandons (with core dump in some systems) when invoked with recurse and perl switches
Summary: grep Abandons (with core dump in some systems) when invoked with recurse and ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grep
Version: 6.6
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Jan Kepler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-25 11:34 UTC by Zebu1er
Modified: 2019-07-11 08:23 UTC (History)
8 users (show)

Fixed In Version: grep-2.20-1.el6
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Important: if this rebase instead contains *only bug fixes,* or *only enhancements*, select the correct option from the Doc Type drop-down list. Rebase package(s) to version: grep-2.20 Highlights, important fixes, or notable enhancements: Fixed several problems that can lead to crash. Speed-up for various operations, some operations can now be magnitude faster. Recursive grep now uses fts for directory traversal, so it can handle much-larger directories without reporting things like "File name too long", and it can run much faster when dealing with large directory hierarchies.
Clone Of:
Environment:
Last Closed: 2015-07-22 06:18:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1360353 0 None None None 2016-09-13 23:43:23 UTC
Red Hat Product Errata RHSA-2015:1447 0 normal SHIPPED_LIVE Low: grep security, bug fix, and enhancement update 2015-07-20 18:43:55 UTC

Description Zebu1er 2014-11-25 11:34:48 UTC
Description of problem:
«grep -r -P» displays «Abandon» error. On some systems it displays «Abandon (core dumped)».
The bug appeared after the update from 6.5 to 6.6 where grep where update too.
Doesn't hang on 7.1406
Doesn't hang when LANG environment variable ends with .iso88591 but always hangs when it ends with .utf8 .

Version-Release number of selected component (if applicable):
Centos 6.6 x64

How reproducible:
Having recurse and Perl switches together set.

Steps to Reproduce:
1.LANG=en_US.utf8 grep -r -P 'blabla' /etc

Actual results:
«Abandon» displayed immediately then stopping with exit code 134

Expected results:
Searching mentioned directory and subdirs and print out eventual matching files

Additional info:

# strace grep -r -P 'blabla' /etc (last lines) :

stat("/etc/ssl/certs/ca-bundle.trust.crt", {st_mode=S_IFREG|0644, st_size=1005005, ...}) = 0
open("/etc/ssl/certs/ca-bundle.trust.crt", O_RDONLY) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff158548d0) = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "# This is a bundle of X.509 cert"..., 32768) = 32768
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 30287
tgkill(30287, 30287, SIGABRT)           = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT (core dumped) +++
Abandon (core dumped)
134

NOTE : pcre library package is 1.5 year older than grep one.

# rpm -qi grep :

Name        : grep                         Relocations: (not relocatable)
Version     : 2.6.3                             Vendor: CentOS
Release     : 6.el6                         Build Date: mer. 04 juin 2014 11:07:59 CEST
Install Date: jeu. 30 oct. 2014 11:00:59 CET      Build Host: c6b10.bsys.dev.centos.org
Group       : Applications/Text             Source RPM: grep-2.6.3-6.el6.src.rpm
Size        : 803838                           License: GPLv3+
Signature   : RSA/SHA1, mer. 04 juin 2014 12:07:31 CEST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>

# rpm -qi pcre :

Name        : pcre                         Relocations: (not relocatable)
Version     : 7.8                               Vendor: CentOS
Release     : 6.el6                         Build Date: ven. 07 sept. 2012 13:03:41 CEST
Install Date: mer. 13 mars 2013 23:12:11 CET      Build Host: c6b8.bsys.dev.centos.org
Group       : System Environment/Libraries   Source RPM: pcre-7.8-6.el6.src.rpm
Size        : 526268                           License: BSD
Signature   : RSA/SHA1, ven. 07 sept. 2012 15:12:35 CEST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>

Comment 2 Trevor Hemsley 2014-11-25 12:14:04 UTC
Problem is triggered by line 448 in /etc/ssl/certs/ca-bundle.trust.crt which contains a strange character. Running less shows it as <ED> and vi as í. Offending line is 

                    Explicit Text: Limitaciones de garantías de este certificado se pueden encontrar en la DPC.

Comment 3 Zebu1er 2014-11-25 13:24:18 UTC
Problem applies to any file searched by grep where there are «incompatible» characters with UTF-8, problem can be formalised with that basic command :

# printf 'before\222after\n' | LANG=en_US.utf8 grep -P '\222'
Abandon (core dumped)

# printf 'before\222after\n' | LANG=en_US.iso88591 grep -P '\222'
beforeÞafter


That example is inspired of a very similar bug of grep 2.6.2+ :
http://permalink.gmane.org/gmane.comp.gnu.grep.bugs/4779

Grep's logs is all about such errors :
http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS

Maybe this one has only been fixed in 2.16 :
  * Noteworthy changes in release 2.16 (2014-01-01) [stable]
  ** Bug fixes
  ...
  The fix to make grep -P work better with UTF-8 made it possible for
  grep to evoke a larger set of PCRE errors, some of which could trigger
  an abort.  E.g., this would abort:
    printf '\x82'|LC_ALL=en_US.UTF-8 grep -P y

Comment 10 errata-xmlrpc 2015-07-22 06:18: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/RHSA-2015-1447.html


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