possible for a 2nd occurrence of a crash not to be sent to errors

Bug #1084296 reported by Brian Murray
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Undecided
Unassigned
apport (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned
Quantal
Fix Released
High
Unassigned

Bug Description

[Test Case]

1) (xeyes &); sleep 1; killall -SEGV xeyes
2) check /var/crash
3) (xeyes &); sleep 1; killall -SEGV xeyes
3) check /var/crash notice that .crash is newer than .upload and .uploaded

Original Description:

I was testing errors in the cloud using juju and created a crash report for d-feet. The first time I did this the a .crash file was created and then a corresponding .upload and .uploaded file were created. The second time I did this a new .crash file was created but a new .upload file was not and subsequently the 2nd occurrence of this crash was not sent to the error tracker.

My /var/crash directory:

-rw-rw-r-- 1 bdmurray whoopsie 0 Nov 28 10:25 _usr_bin_d-feet.1000.upload
-rw------- 1 whoopsie whoopsie 0 Nov 28 13:14 _usr_bin_d-feet.1000.uploaded
-rw-r----- 1 bdmurray whoopsie 3401262 Nov 28 13:43 _usr_bin_d-feet.1000.crash

In apport/fileutils.py we can see that there are no checks done to see if there is already a .upload or .uploaded file:

def mark_report_upload(report):
    report = '%s.upload' % report.rsplit('.', 1)[0]
    with open(report, 'a'):
        pass

So if a .upload for the crash already exists a new one is not created nor is the existing one modified.

Related branches

Revision history for this message
Brian Murray (brian-murray) wrote :

Attached is a test, to be added to test_fileutils.py, that demonstrates the problem.

Changed in apport (Ubuntu):
importance: Undecided → High
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r2540, thanks Brian!

Changed in apport:
status: New → Fix Released
Changed in apport (Ubuntu):
status: New → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

This should be SRU'ed to both Quantal and Precise.

Changed in apport (Ubuntu Precise):
importance: Undecided → High
Changed in apport (Ubuntu Quantal):
importance: Undecided → High
Changed in apport (Ubuntu Precise):
status: New → Triaged
Changed in apport (Ubuntu Quantal):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * New upstream release. Changes since our previous snapshot:
    - debian.py: Only reject reports with useless stack traces if the report
      actually has a stack trace at all.
    - debian.py: Fix UTF-8 string handling. Thanks Ritesh Raj Sarraf.
    - debian.py: Fix crash on broken "Package" fields, as generated by current
      Debian/Ubuntu dkms package.
    - data/apport: Call fsync when writing upstart crash reports.
    - report.py, add_gdb_info(): Handle libnih's assertion messages.
      (LP: #997359)
    - apport-gtk, apport-kde: Don't provide an option to restart a crashed
      application when the crash occurred in a thread (LP: #1033902).
    - apport-retrace: Disallow option -C without option -S. Thanks Kyle
      Nitzsche.
    - fileutils.py, mark_report_upload(): Refresh the .upload stamps if a
      previous version of the report was already uploaded, but another
      instance of the problem happened since then. Thanks Brian Murray. (LP:
      #1084296)
    - Ignore implausibly low addresses when computing
      StacktraceAddressSignature. These are usually artifacts from gdb when
      not having debug symbols, and having too many of them prevents proper
      client-side duplicate detection and proper bucketing in daisy.
      (LP: #1084996)
    - fileutils.py: Ignore .desktop files with NoDisplay=true. (LP: #1048524)
  * debian/tests/control: Run tests as root, just like before switching our
    autopkgtests to run as user "ubuntu" by default. This enables a couple of
    extra tests, and avoids some confusion because the distro and the user
    name are identical.
  * data/package-hooks/source_linux-nexus7.py: Fix PEP-8 error.
 -- Martin Pitt <email address hidden> Fri, 30 Nov 2012 18:00:01 +0100

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I uploaded precise and quantal SRUs for this to the review queue.

Changed in apport (Ubuntu Precise):
status: Triaged → In Progress
Changed in apport (Ubuntu Quantal):
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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-0ubuntu8 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 change the bug tag from verification-needed to verification-done. If it does not, 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!

description: updated
Changed in apport (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apport/2.0.1-0ubuntu16 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 change the bug tag from verification-needed to verification-done. If it does not, 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 Precise):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

The proposed version of the package in quantal is crashing with this Traceback:

Traceback:
 Traceback (most recent call last):
   File "/usr/share/apport/apport-gtk", line 588, in <module>
     app.run_argv()
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 668, in run_argv
     return self.run_crashes()
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 201, in run_crashes
     self.run_crash(f)
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 288, in run_crash
     apport.fileutils.mark_report_upload(report_file)
   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 114, in mark_report_upload
     os.unlink(uploaded)
 OSError: [Errno 1] Operation not permitted: '/var/crash/_usr_bin_d-feet.1000.uploaded'

Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apport/2.0.1-0ubuntu17 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 change the bug tag from verification-needed to verification-done. If it does not, 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!

Revision history for this message
Brian Murray (brian-murray) wrote :

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-0ubuntu9 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 change the bug tag from verification-needed to verification-done. If it does not, 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!

Revision history for this message
Brian Murray (brian-murray) wrote :

I tested apport version 2.6.1-0ubuntu9 in quantal-proposed and was able to submit a 2nd instance of a crash regarding a previously crashed application without any issue. Additionally, this time apport did not crash when trying to process the crash from the other application.

tags: added: verification-done-quantal
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * Fix OSError crash in mark_report_upload(); regression from
    2.6.1-0ubuntu8.

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

  * Ignore implausibly low addresses when computing
    StacktraceAddressSignature. These are usually artifacts from gdb when not
    having debug symbols, and having too many of them prevents proper
    client-side duplicate detection and proper bucketing in daisy.
    Backported from trunk r2541. (LP: #1084996)
  * mark_report_upload(): Refresh the .upload stamps if a previous version of
    the report was already uploaded, but another instance of the problem
    happened since then. Thanks Brian Murray. Backported from trunk r2540.
    (LP: #1084296)

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

  * data/general-hooks/ubuntu.py: Deal with dpkg_log file being a string
    instead of bytes (LP: #1080915)
 -- Martin Pitt <email address hidden> Wed, 05 Dec 2012 10:16:00 +0000

Changed in apport (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Since precise verification is not done yet, I am going to add the fix for bug #1045986 and upload a new version for precise (this patch will be released in -security later today).

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Uploaded 2.0.1-0ubuntu17.1 with the hardening fix. Please test it instead.

Changed in apport (Ubuntu Precise):
status: Fix Committed → In Progress
tags: removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Brian, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apport/2.0.1-0ubuntu17.1 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 Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Using apport version 2.0.1-0ubuntu17.1 from precise-proposed I observed a new .uploaded file being created for a 2nd instance of an application crash which indicates that the crash was in fact set to the crash database.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.0.1-0ubuntu17.1

---------------
apport (2.0.1-0ubuntu17.1) precise-proposed; urgency=low

  * bin/apport-bug: Explicitly set the PATH to that of ENV_SUPATH in
    /etc/login.defs and unset ENV and CDPATH. We need do this so that confined
    applications using ubuntu-browsers.d/ubuntu-integration cannot abuse the
    environment to escape AppArmor confinement via this script (LP: #1045986).

apport (2.0.1-0ubuntu17) precise-proposed; urgency=low

  * Fix OSError crash in mark_report_upload(); regression from
    2.0.1-0ubuntu16.

apport (2.0.1-0ubuntu16) precise-proposed; urgency=low

  * Ignore implausibly low addresses when computing
    StacktraceAddressSignature. These are usually artifacts from gdb when not
    having debug symbols, and having too many of them prevents proper
    client-side duplicate detection and proper bucketing in daisy.
    Backported from trunk r2541. (LP: #1084996)
  * mark_report_upload(): Refresh the .upload stamps if a previous version of
    the report was already uploaded, but another instance of the problem
    happened since then. Thanks Brian Murray. Backported from trunk r2540.
    (LP: #1084296)
 -- Jamie Strandboge <email address hidden> Mon, 17 Dec 2012 16:20:20 -0600

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.