string matching for dpkg I/O errors in dpkgpm.cc is out of date

Bug #1363257 reported by Brian Murray on 2014-08-29
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
High
Brian Murray
Trusty
High
Unassigned

Bug Description

The following error strings are no longer returned by dpkg:

   io_errors.push_back(string("failed to read on buffer copy for %s"));
   io_errors.push_back(string("failed in write on buffer copy for %s"));
   io_errors.push_back(string("short read on buffer copy for %s"));

Subsequently, apport package installation failures are being created for these types of crashes and they should not be. Additionally, there is a new error returned by dpkg ("unexpected end of file or stream" as seen in bug 1361489) which should also be blocked.

Brian Murray (brian-murray) wrote :

Reviewing the strings returned by lib/dpkg/buffer.c the following patch should resolve the issue, although this is still not ideal.

 $ bzr cdiff
=== modified file 'apt-pkg/deb/dpkgpm.cc'
--- apt-pkg/deb/dpkgpm.cc 2014-06-10 19:00:00 +0000
+++ apt-pkg/deb/dpkgpm.cc 2014-08-29 20:41:09 +0000
@@ -1668,9 +1668,10 @@
    // do not report dpkg I/O errors, this is a format string, so we compare
    // the prefix and the suffix of the error with the dpkg error message
    vector<string> io_errors;
- io_errors.push_back(string("failed to read on buffer copy for %s"));
- io_errors.push_back(string("failed in write on buffer copy for %s"));
- io_errors.push_back(string("short read on buffer copy for %s"));
+ io_errors.push_back(string("failed to read"));
+ io_errors.push_back(string("failed to write"));
+ io_errors.push_back(string("failed to seek"));
+ io_errors.push_back(string("unexpected end of file or stream"));

    for (vector<string>::iterator I = io_errors.begin(); I != io_errors.end(); ++I)

Brian Murray (brian-murray) wrote :

I've looked around Launchpad for package failures with the string "failed to (read|write|seek)" and haven't found any, I've only found errors regarding "unexpected end of file or stream". The other apport package failures not showing up may be due to bug 1353171 though.

Changed in apt (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
Changed in apt (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
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

Hello Brian, 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

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.

tags: added: verification-done
removed: verification-needed
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.

Duplicates of this bug

Other bug subscribers