apport hook fails in add_info with TypeError: 'str' does not support the buffer interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apport (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Brian Murray |
Bug Description
Impact
------
Some apport package hooks are not able to check the contents of log files for errors, e.g. looking for hard disk errors in ubiquity install logs, so we may be getting crash reports that we don't want.
Test Case
---------
⟫ ubuntu-bug ubiquity
dpkg-query: aucun paquet ne correspond à ubiquity
ERROR: hook /usr/share/
Traceback (most recent call last):
File "/usr/lib/
symb[
File "/usr/share/
if 'Buffer I/O error on device' in syslog:
TypeError: 'str' does not support the buffer interface
With the version of the package in the archive you'll see the above Traceback, with the version of proposed you will not.
Regression Potential
-------
The change uses a try, except clause to do the decoding of the log file so there should be little chance of a regression.
ProblemType: BugDistroRelease: Ubuntu 15.04
Package: ubiquity (not installed)
ProcVersionSign
Uname: Linux 3.19.0-14-generic x86_64
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Apr 21 10:15:56 2015
InstallationDate: Installed on 2013-09-03 (594 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130902)
UpgradeStatus: No upgrade log present (probably fresh install)
affects: | ubiquity (Ubuntu) → apport (Ubuntu) |
Changed in apport (Ubuntu): | |
assignee: | Martin Pitt (pitti) → nobody |
From the research I've done, it looks like this is a result of the following change:
$ bzr log -r1369.34.1105 -p ------- ------- ------- ------- ------- ------- ------- ---- /launchpad. net/bugs/ 1370259 root_command_ outputs( ): Fix UnicodeDecodeError crash for non-textual values. (LP: #1370259)
-------
revno: 1369.34.1105
fixes bug: https:/
committer: Martin Pitt <email address hidden>
branch nick: apport
timestamp: Thu 2015-01-08 11:20:16 +0100
message:
* hookutils, attach_
diff:
=== modified file 'NEWS'
--- NEWS 2014-12-19 06:43:26 +0000
+++ NEWS 2015-01-08 10:20:16 +0000
@@ -1,6 +1,11 @@
This file summarizes the major and interesting changes for each release. For a
detailed list of changes, please see ChangeLog.
+2.15.2 (UNRELEASED) root_command_ outputs( ): Fix UnicodeDecodeError crash for ------- ------ test_get_ timestamp test.
+------------------
+ * hookutils, attach_
+ non-textual values. (LP: #1370259)
+
2.15.1 (2014-12-19)
------
* Robustify report.
=== modified file 'apport/ hookutils. py' path.join( workdir, keyname)) as f: path.join( workdir, keyname), 'rb') as f:
buf = f.read().strip()
--- apport/hookutils.py 2014-04-29 17:34:35 +0000
+++ apport/hookutils.py 2015-01-08 10:20:16 +0000
@@ -465,7 +465,7 @@
# now read back the individual outputs
for keyname in command_map:
try:
- with open(os.
+ with open(os.
except IOError:
# this can happen if the user dismisses authorization in
This then makes the files added by the ubiquity hook bytes, which when then can't check for strings in.