Bug 832085

Summary: core_pattern with %e (executable filename) is not matched correctly in abrt-install-ccpp-hook
Product: [Fedora] Fedora Reporter: Richard Jørgensen <bugzilla_redhat_com>
Component: abrtAssignee: abrt <abrt-devel-list>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: abrt-devel-list, bugzilla_redhat_com, dvlasenk, iprikryl, jmoskovc, kklic, mmilata, mtoman, npajkovs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 851097 (view as bug list) Environment:
Last Closed: 2012-08-30 00:56:59 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: 851097    

Description Richard Jørgensen 2012-06-14 13:30:22 UTC
Description of problem:
Including executable filename in coredump dumpfile pattern name only produces a "e" in place of the filename.

The problem stems from this line in /usr/sbin/abrt-install-ccpp-hook:
        if test x"${cur#.*%e}" = x"${cur}"; then
which should have been:
        if test x"${cur#*%e}" = x"${cur}"; then

'.*' is regexp for matching all but bash variable expansion uses shell expansion where '*' matches all. abrt-install-ccpp-hook only works correct on %e if /proc/sys/kernel/core_pattern starts with '.'.

Version-Release number of selected component (if applicable):
abrt-addon-ccpp-2.0.10-4.fc17.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Stop abrt-ccpp.service
2. Set core_pattern to core.%e
3. Start abrt-ccpp.service
4. Make a coredump
  
Actual results:
# systemctl stop abrt-ccpp.service
# echo "core.%e" >/proc/sys/kernel/core_pattern 
# systemctl start abrt-ccpp.service
# cat /proc/sys/kernel/core_pattern
|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e
# ulimit -c unlimited
# cat &
[1] 8487
# kill -11 %1

[1]+  Stopped                 cat
# fg
cat
Segmentation fault (core dumped)
# ls -l core*
-rw------- 1 root root 376832 Jun 14 15:27 core.e


Expected results:
# systemctl stop abrt-ccpp.service
# echo "core.%e" >/proc/sys/kernel/core_pattern 
# systemctl start abrt-ccpp.service
# cat /proc/sys/kernel/core_pattern
|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %e
# ulimit -c unlimited
# cat &
[1] 8487
# kill -11 %1

[1]+  Stopped                 cat
# fg
cat
Segmentation fault (core dumped)
# ls -l core*
-rw------- 1 root root 376832 Jun 14 15:27 core.cat

Additional info:
Same bug also verified in Red Hat Enterprise Linux 6.2

Comment 1 Denys Vlasenko 2012-06-15 10:12:09 UTC
Fixed in git:

commit e8dff80c426978fed954e83787707e60bc6e7e89
Author: Denys Vlasenko <vda.linux>
Date:   Fri Jun 15 12:10:35 2012 +0200

    abrt-install-ccpp-hook: fix the check for %e presense. Closes rhbz#832085

Comment 2 Fedora Update System 2012-08-03 10:27:21 UTC
abrt-2.0.11-1.fc17,libreport-2.0.11-1.fc17,btparser-0.18-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/abrt-2.0.11-1.fc17,libreport-2.0.11-1.fc17,btparser-0.18-2.fc17

Comment 3 Fedora Update System 2012-08-05 21:34:25 UTC
Package abrt-2.0.11-1.fc17, btparser-0.18-2.fc17, libreport-2.0.12-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing abrt-2.0.11-1.fc17 btparser-0.18-2.fc17 libreport-2.0.12-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11529/abrt-2.0.11-1.fc17,libreport-2.0.12-1.fc17,btparser-0.18-2.fc17
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-08-09 23:09:39 UTC
Package libreport-2.0.12-2.fc17, abrt-2.0.11-1.fc17, btparser-0.18-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libreport-2.0.12-2.fc17 abrt-2.0.11-1.fc17 btparser-0.18-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11529/abrt-2.0.11-1.fc17,libreport-2.0.12-2.fc17,btparser-0.18-2.fc17
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-08-23 23:28:09 UTC
Package abrt-2.0.12-1.fc17, libreport-2.0.13-1.fc17, btparser-0.18-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing abrt-2.0.12-1.fc17 libreport-2.0.13-1.fc17 btparser-0.18-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11529/abrt-2.0.12-1.fc17,libreport-2.0.13-1.fc17,btparser-0.18-2.fc17
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-08-30 00:56:59 UTC
abrt-2.0.12-1.fc17, libreport-2.0.13-2.fc17, btparser-0.18-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.