← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/bug-1300235 into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/bug-1300235 into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1300235 in chromium-browser (Ubuntu): "init (chromium-browser) crashed with SIGSEGV"
  https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1300235

For more details, see:
https://code.launchpad.net/~brian-murray/apport/bug-1300235/+merge/253250
-- 
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/bug-1300235 into lp:apport.
=== modified file 'data/apport'
--- data/apport	2014-12-02 09:47:58 +0000
+++ data/apport	2015-03-17 18:25:28 +0000
@@ -266,15 +266,18 @@
 # apport can't be found, then simply log an entry in the host error log
 # and exit 0.
 if len(sys.argv) == 5 and sys.argv[4].isdigit() and sys.argv[4] != sys.argv[1]:
-    if os.path.exists('/proc/%s/root/%s' % (sys.argv[4], __file__)):
+    host_pid = sys.argv[4]
+    pid = sys.argv[1]
+    if os.path.exists('/proc/%s/root/%s' % (host_pid, __file__)):
         error_log('pid %s (host pid %s) crashed in a container with apport '
-                  'support, forwarding' % (sys.argv[1], sys.argv[4]))
+                  'support, forwarding' % (pid, host_pid))
         sys.stderr.flush()
-        os.execv('/usr/sbin/chroot', ('chroot', '/proc/%s/root/' % sys.argv[4],
-                                      __file__, sys.argv[1], sys.argv[2],
+        os.execv('/usr/sbin/chroot', ('chroot', '/proc/%s/root/' % host_pid,
+                                      __file__, host_pid, sys.argv[2],
                                       sys.argv[3]))
     else:
-        error_log('pid %s crashed in a container without apport support' % sys.argv[4])
+        error_log('host pid %s crashed in a container without apport support' %
+                  host_pid)
         sys.exit(0)
 
 check_lock()