From 49898ac56d1ddf472c330c4ace12482f80b00649 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 3 Dec 2009 14:20:10 -0500 Subject: Report signal names in some summaries; hardcoded detection of some duplicates --- abrt-triage.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/abrt-triage.py b/abrt-triage.py index ccd1ef3..b88bd5f 100755 --- a/abrt-triage.py +++ b/abrt-triage.py @@ -31,6 +31,26 @@ class Bug(object): for arg in m.group(1).split()[1:]: if arg.startswith('/'): return arg + + def get_abrt_reason(self): + for line in self._bug.longdescs[0]['body'].splitlines(): + m = re.match('reason: (.+)', line) + if m: + return m.group(1) + + def get_abrt_signal(self): + reason = self.get_abrt_reason() + if reason is None: + return + + m = re.match('Process was terminated by signal ([0-9]+)', reason) + if m: + sig = int(m.group(1)) + import signal + for signame in dir(signal): + if signame.startswith('SIG'): + if getattr(signal, signame) == sig: + return signame class NoBacktrace(Exception): pass @@ -129,10 +149,12 @@ class Change(object): def __init__(self, newsummary=None, newcomponent=None, - comment=None): + comment=None, + duplicate_id=None): self.comment = comment self.newsummary = newsummary self.newcomponent = newcomponent + self.duplicate_id = duplicate_id def __str__(self): result = '' @@ -150,10 +172,31 @@ class Change(object): result += '---- BEGIN COMMENT ----\n' result += self.comment result += '\n---- END COMMENT ----\n' + + if self.duplicate_id: + result += '---- MARK AS DUPLICATE OF: %i ----\n' % self.duplicate_id + return result +class Duplicate(Change): + def __init__(self, bz, other_bug_id): + Change.__init__(self, + comment=( +'''Thank you for the bug report. + +This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.'''), + duplicate_id = other_bug_id + ) + def get_change(bz, bug_id): bug = Bug(bz, bug_id) + + signal = bug.get_abrt_signal() + if signal: + issue = signal + else: + issue = 'Crash' + script = bug.get_script() # script = '/usr/bin/deluged' if script: @@ -165,8 +208,9 @@ def get_change(bz, bug_id): bt = bug.get_backtrace() (thread, frame) = bt.get_crash_site() (newsummary, bt_blurb) = characterize_bt(bt, thread, script) + except NoBacktrace, e: - return Change(newsummary='Crash running %s' % script, + return Change(newsummary='%s running %s' % (issue, script), newcomponent = pkg, comment=('''Thank you for the bug report. @@ -176,7 +220,7 @@ Thank you. ''') ) except UnsupportedComponent, e: - return Change(newsummary='Crash in %s' % e.path, + return Change(newsummary='%s in %s' % (issue, e.path), comment=('''Thank you for the bug report. Unfortunately the problem appears to be in %(path)s. @@ -201,10 +245,14 @@ Reassigning component from "python" to "%(pkg)s" ''' % dict(pkg=pkg, bt_blurb = bt_blurb) + if newsummary == 'Fatal error in "_XError" in /usr/share/virt-manager/virt-manager.py': + return Duplicate(bz, 540810) + ch = Change(newsummary = newsummary, newcomponent = pkg, comment = comment ) + print ch print '---- BEGIN THREAD ----' for id in sorted(thread.frames.keys()): -- cgit