Misparses dpkg status line, fails to write apport reports

Bug #1353171 reported by Anders Kaseorg on 2014-08-05
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
High
Unassigned
Trusty
High
Unassigned

Bug Description

Test Case
---------
1) sudo apt-add-repository ppa:daisy-pluckers/daisy-seeds
2) sudo apt-get update
3) sudo apt-get install crash-in-postinst
4) observe a package installation failure dialog

With the version of apt in the archive you will *not* receive a crash file in /var/crash. If you install the version of apt from -proposed you should receive a crash file in /var/crash and an apport dialog should appear.

For a while apt has not been writing apport reports for dpkg maintainer script errors. Here’s why:

• pkgDPkgPM::ProcessDpkgStatusLine sees a line like
"status: cyrus-clients : error : subprocess installed post-installation script returned error exit status 1".
• StringSplit splits it into
list == {"status", "cyrus-clients ", "error ", "subprocess installed post-installation script returned error exit status 1"}.
• pkgname is set to Strip(list[1]) == "cyrus-clients".
• However, the original list[1] == "cyrus-clients " (with a trailing space) is passed to WriteApportReport.
• WriteApport fails to find "cyrus-clients " in the cache, and bails out.

Patch attached.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: libapt-pkg4.12 1.0.4ubuntu6
ProcVersionSignature: Ubuntu 3.16.0-6.11-generic 3.16.0-rc7
Uname: Linux 3.16.0-6-generic x86_64
NonfreeKernelModules: openafs
ApportVersion: 2.14.5-0ubuntu3
Architecture: amd64
Date: Tue Aug 5 19:19:39 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2010-12-05 (1339 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
SourcePackage: apt
UpgradeStatus: Upgraded to utopic on 2013-10-31 (278 days ago)

Anders Kaseorg (andersk) wrote :
description: updated

The attachment "apt-ProcessDpkgStatusLine-strip.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Changed in apt (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in apt (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
Brian Murray (brian-murray) wrote :

Thanks for the patch, I've uploaded it to utopic.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.0.4ubuntu8

---------------
apt (1.0.4ubuntu8) utopic; urgency=medium

  * apt-pkg/deb/dpkgpm.cc:
    - update string matching for dpkg I/O errors. (LP: #1363257)
    - properly parse the dpkg status line so that package name is properly set
      and an apport report is created. Thanks to Anders Kaseorg for the patch.
      (LP: #1353171)
 -- Brian Murray <email address hidden> Fri, 29 Aug 2014 15:15:17 -0700

Changed in apt (Ubuntu):
status: Triaged → Fix Released
description: updated
Anders Kaseorg (andersk) on 2014-09-08
description: updated

Hello Anders, or anyone else affected,

Accepted apt into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/apt/1.0.1ubuntu2.6 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 apt (Ubuntu Trusty):
status: Triaged → Fix Committed
tags: added: verification-needed
Mathew Hodson (mathew-hodson) wrote :

Fixed with libapt-pkg4.12 (1.0.1ubuntu2.6) in trusty-proposed.

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

The verification of the Stable Release Update for apt 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 regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.0.1ubuntu2.6

---------------
apt (1.0.1ubuntu2.6) trusty-proposed; urgency=medium

  * apt-pkg/deb/dpkgpm.cc:
    - update string matching for dpkg I/O errors. (LP: #1363257)
    - properly parse the dpkg status line so that package name is properly set
      and an apport report is created. Thanks to Anders Kaseorg for the patch.
      (LP: #1353171)
 -- Brian Murray <email address hidden> Wed, 08 Oct 2014 14:01:41 -0700

Changed in apt (Ubuntu Trusty):
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