possible for ExecutableTimestamp to not be for the binary in ExecutablePath

Bug #1077253 reported by Brian Murray on 2012-11-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)

Bug Description

[Test Case]
One convoluted way to test this the following:
1) on a quantal system run 'do-release-upgrade -d'
2) cancel the upgrade
3) switch to the release upgrader directory '/tmp/ubuntu-release-upgrade-XYZ'
4) edit DistUpgradeController.py create a new line (number 407) after 'if.self.config.getWithDefault...' with the contents 'x = (10 / 0)'. This will cause the release upgrader to crash the next time it is run.
5) in /tmp/ubuntu-release-upgrader-XYZ run the following:
'sudo /usr/bin/python /tmp/ubuntu-release-upgrader-XYZ/raring --sandbox'

Observe the release upgrader crash. If you inspect the contents of the crash file, /var/crash/_usr_bin_do-release-upgrade.0.crash you'll notice that with the current version of apport, additional system information is not collected - you will not find Dependencies in the .crash file. With the version of apport from -proposed you will find this.

I was testing bug 1067542 again and ran into a situation where release upgrade crash was unreportable because the binary had changed.

Digging into the issue DistUpgradeApport.py from update-manager / ubuntu-release-upgrader sets ExecutablePath = '/usr/bin/do-release-upgrade', however ProcCmdline = '/usr/bin/python /tmp/update-manager-xyz/quantal' (from the dist upgrade tarball).

Then when add_proc_info calls _check_interpreted (in apport/report.py) ExecutablePath is temporarily set to '/tmp/update-manager-xyz/quantal' and the ExecutableTimestamp is calculated using that ExecutablePath. Later, on when collect_info (in apport/ui.py) is run we use the "real" ExecutablePath, '/usr/bin/do-release-upgrade' in this example, which will have a different ExecutableTimestamp than the one written to the report during _check_interpreted.

This ultimately, makes reporting crashes in the release upgrader not reportable.

Brian Murray (brian-murray) wrote :

I believe this simple modification to test_python_crashes.py demonstrates the problem:

=== modified file 'test/test_python_crashes.py'
--- test/test_python_crashes.py 2012-08-28 22:16:25 +0000
+++ test/test_python_crashes.py 2012-11-09 23:24:49 +0000
@@ -136,6 +136,8 @@
             'Traceback', 'ProblemType', 'ProcEnviron', 'ProcStatus',
             'ProcCmdline', 'Date', 'ExecutablePath', 'ProcMaps',
+ self.assertEqual(pr['ExecutableTimestamp'],
+ str(int(os.stat(pr['ExecutablePath']).st_mtime)))
             'report has necessary fields')
         self.assertTrue('bin/python' in pr['InterpreterPath'])

Martin Pitt (pitti) wrote :

I believe this is fixed with http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/2570 now. This contains your (slightly modified) test case. In r2569 I made sure that ExecutableTimestamp works in general for Python programs.

Changed in apport (Ubuntu):
status: New → Fix Committed
Changed in apport (Ubuntu Quantal):
importance: Undecided → High
status: New → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.8-0ubuntu1

apport (2.8-0ubuntu1) raring; urgency=low

  * New upstream release:
    - Factor out sandbox management functions from apport-retrace into
      apport/sandboxutils.py, so that other programs can re-use the API
      easily. Thanks to Kyle Nitzsche for the initial work on this.
    - Generate a crash signature for kernel OOPSes.
    - Add "apport-valgrind" tool to produce valgrind reports in a temporary
      sandbox with debug symbols (similar to apport-retrace). Thanks Alex
      Chiang and Kyle Nitzsche!
    - Fix StacktraceAddressSignature generation on ARM. (LP: #1089778)
    - debian.py: Fix TypeError crash in payload generation. Thanks Ritesh Raj
    - apport_python_hook.py: Update "ExecutableTimestamp" field when mangling
      "ExecutablePath". (LP: #1077253)
  * Add new apport-valgrind binary package.
  * Re-enable Launchpad crash reports for raring.
 -- Martin Pitt <email address hidden> Tue, 08 Jan 2013 08:39:35 +0100

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
description: updated
description: updated
Brian Murray (brian-murray) wrote :

I've uploaded this to the quantal -proposed queue now.

Hello Brian, or anyone else affected,

Accepted apport into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apport/2.6.1-0ubuntu10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apport (Ubuntu Quantal):
status: Triaged → Fix Committed
tags: added: verification-needed
Brian Murray (brian-murray) wrote :

I tested this using apport version 2.6.1-0ubuntu10 from precise-proposed and observed that my crash report included Dependencies.txt so apport did collect additional data.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.6.1-0ubuntu10

apport (2.6.1-0ubuntu10) quantal-proposed; urgency=low

  * apport_python_hook.py: Update "ExecutableTimestamp" field when mangling
    "ExecutablePath". (LP: #1077253)
 -- Brian Murray <email address hidden> Fri, 11 Jan 2013 10:59:53 -0800

Changed in apport (Ubuntu Quantal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers