Bug 625445

Summary: python hook doesn't report unhandled exceptions for scripts run without full length path
Product: [Fedora] Fedora Reporter: Roman Rakus <rrakus>
Component: abrtAssignee: Denys Vlasenko <dvlasenk>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: anton, dvlasenk, iprikryl, jmoskovc, kklic, mtoman, npajkovs, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: abrt-2.0.7-2.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-16 19:53:29 UTC Type: ---
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: 744774    

Description Roman Rakus 2010-08-19 13:27:28 UTC
Description of problem:
python hook only process exception from scripts run with full path (starting with `'' character)

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


How reproducible:
always

Steps to Reproduce:
1. set ProcessUnpackaged = yes in abrt.conf and restart abrt daemon
2. echo "raise IOError" > test.py && python test.py
3. echo "raise IOError" > test.py && python $PWD/test.py
  
Actual results:
In the step 2 abrt will not catch exception
In the step 3 abrt will catch exception

Expected results:
Should catch exception in both cases

Additional info:
Looked in the source code;
src/hooks/abrt_exception_handler.py.in:94
        if sys.argv[0][0] != "/":
            # Relative path - can't reliably determine package
            # this script belongs to - abort dumping
            # TODO: check abrt.conf and abort only if
            # ProcessUnpackaged = no?
            raise Exception

I guess it should be erased. Tried it and it works.

Comment 1 Roman Rakus 2010-08-19 13:36:16 UTC
(In reply to comment #0)
> Description of problem:
> python hook only process exception from scripts run with full path (starting
> with `'' character)
> 
starting with `/' character...

Comment 2 Denys Vlasenko 2011-07-19 08:43:33 UTC
What would be the point in reporting a bug against a script from unknown package?

And in your example:

echo "raise IOError" > test.py && python test.py

the script isn't from any package at all. Consider the case when someone develops Python software. Do you think it would be appreciated when every crash during development will cause abrt to pop up?

Comment 3 Roman Rakus 2011-07-20 11:51:20 UTC
My point wasn't to report a bug, but to catch an exception. I found it useful.
Anyway, if you are asking for point - what is the point of `ProcessUnpackaged' in abrt.conf?

Comment 4 Denys Vlasenko 2011-07-22 15:04:59 UTC
We discussed this on mtg and decided to make it work for ProcessUnpackaged=no setting

Comment 5 Roman Rakus 2011-07-22 15:13:49 UTC
Just to be sure - with ProcessUnpackaged=no abrt will catch exceptions for my unpackaged python script run with not absolute path?
And with ProcessUnpackaged=yes abrt will catch only exceptions for my unpackaged python script run with absolute path?

Comment 6 Denys Vlasenko 2011-10-20 20:37:56 UTC
Fixed in git:

commit 57963a02011b2b6f220158936311db6704237b57
Author: Denys Vlasenko <dvlasenk>
Date:   Thu Oct 20 22:34:55 2011 +0200

    python: allow saving of crashes in non-abspath scripts. Closes rhbz#625445.

    The behavior is off by default. It can be enabled by
    setting RequireAbsolutePath to "no" in /etc/abrt/plugins/python.conf.

Comment 7 Fedora Update System 2011-12-10 11:05:52 UTC
abrt-2.0.7-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/abrt-2.0.7-2.fc16

Comment 8 Fedora Update System 2011-12-11 21:57:22 UTC
Package abrt-2.0.7-2.fc16, libreport-2.0.8-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 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.7-2.fc16 libreport-2.0.8-3.fc16'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16990/libreport-2.0.8-3.fc16,abrt-2.0.7-2.fc16
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2011-12-16 19:53:29 UTC
abrt-2.0.7-2.fc16, libreport-2.0.8-3.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.