← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/fix-SAS-generation into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/fix-SAS-generation into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1533349 in Apport: "StacktraceAddressSignature is generated using suboptimal function"
  https://bugs.launchpad.net/apport/+bug/1533349

For more details, see:
https://code.launchpad.net/~brian-murray/apport/fix-SAS-generation/+merge/282476
-- 
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/fix-SAS-generation into lp:apport.
=== modified file 'apport/report.py'
--- apport/report.py	2015-10-27 13:05:47 +0000
+++ apport/report.py	2016-01-13 17:33:31 +0000
@@ -673,6 +673,8 @@
           inclusion into bug reports and easier processing
         - AssertionMessage: Value of __abort_msg, __glib_assert_msg, or
           __nih_abort_msg if present
+        - StacktraceAddressSignature: A signature suitable for identifying
+          duplicates.
 
         The optional rootdir can specify a root directory which has the
         executable, libraries, and debug symbols. This does not require
@@ -751,7 +753,9 @@
 
         if 'Stacktrace' in self:
             self._gen_stacktrace_top()
-            addr_signature = self.crash_signature_addresses()
+            addr_signature = self.crash_signature()
+            if not addr_signature:
+                addr_signature = self.crash_signature_addresses()
             if addr_signature:
                 self['StacktraceAddressSignature'] = addr_signature
 

=== modified file 'bin/apport-retrace'
--- bin/apport-retrace	2015-09-24 12:19:28 +0000
+++ bin/apport-retrace	2016-01-13 17:33:31 +0000
@@ -402,7 +402,12 @@
 
     else:
         if options.output is None:
-            out = open(options.report, 'wb')
+            try:
+                out = open(options.report, 'wb')
+            except PermissionError:
+                apport.error("Cannot write to %s, writing to %s.retraced instead." %
+                             (options.report, options.report))
+                out = open('%s.out' % options.report, 'wb')
         elif options.output == '-':
             if sys.version[0] < '3':
                 out = sys.stdout