diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-17 14:09:31 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-17 14:09:31 +0200 |
commit | cfbecb63dd7c5a286df08b23ea803f4dc1459231 (patch) | |
tree | d24add60894acd7492ef7a3cfd9526d275c42ab2 /src | |
parent | c3e22cc6266b4a4a02c01ac9449db046b45f6a9e (diff) | |
download | abrt-cfbecb63dd7c5a286df08b23ea803f4dc1459231.tar.gz abrt-cfbecb63dd7c5a286df08b23ea803f4dc1459231.tar.xz abrt-cfbecb63dd7c5a286df08b23ea803f4dc1459231.zip |
do not create Python dumps if argv[0] is not absolute
This should fix
https://bugzilla.redhat.com/show_bug.cgi?id=547407
rhythmbox crash: abrt says "Executable doesn't belong to any package"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Hooks/abrt_exception_handler.py.in | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index 8a5d8060..80bfef31 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -30,9 +30,6 @@ import subprocess def write_dump(pid, tb): executable = "Exception raised from python shell" if sys.argv[0]: - # FIXME: is this reliable?! - # what if argv[0] is relative and we chdir'ed somewhere - # during execution? executable = os.path.abspath(sys.argv[0]) command = ["/usr/libexec/abrt-hook-python"] @@ -79,10 +76,17 @@ def handleMyException((etype, value, tb)): # "-c" appears in this case: # $ python -c 'import sys; print "argv0 is:%s" % sys.argv[0]' # argv0 is:-c - if sys.argv[0] and sys.argv[0] != "-c": - syslog.syslog("abrt: detected unhandled Python exception in %s" % sys.argv[0]) - else: # interactive Python etc + if not sys.argv[0] or sys.argv[0] == "-c": + # Looks like interactive Python - abort dumping syslog.syslog("abrt: detected unhandled Python exception") + throw + syslog.syslog("abrt: detected unhandled Python exception in %s" % sys.argv[0]) + 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? + throw elist = traceback.format_exception(etype, value, tb) tblast = traceback.extract_tb(tb, limit=None) |