Bug reporting can fail if invalid characters are in Xorg.0.log

Bug #1098395 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xdiagnose (Ubuntu)
Fix Released
High
Bryce Harrington

Bug Description

In raring we're using a new xorglog.py parser to extract info from the Xorg.0.log file.

However, parsing of this file will fail if it includes invalid data characters, and that failure will crash ubuntu-bug. It is uncommon for there to be invalid characters in Xorg.0.log, but it can happen sometimes via funky EDIDs for example.

The problem is not with the apport hook, but with python itself; this can be reproduced independently of apport:

$ python
Python 2.7.3 (default, Jan 6 2013, 12:15:04)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> buf = open('/var/log/Xorg.0.log', 'rb').read()
>>> len(buf)
26205
>>> ubuf = buf.decode('utf8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 10154: invalid start byte
>>> buf[10140:10180]
'tel(0): XX31G\x80B133XW1\n[ 27.376] (II)'
>>>

Also:

$ iconv -f UTF-8 /var/log/Xorg.0.log -o /dev/null
iconv: illegal input sequence at position 10154

The apport hook will need to catch this error, and bypass use of parsed log data if this happens.

Revision history for this message
Bryce Harrington (bryce) wrote :
Changed in xdiagnose (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Bryce Harrington (bryce)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdiagnose - 3.4

---------------
xdiagnose (3.4) raring; urgency=low

  * bin/xrotate: Add new script to manually rotate screen and input.
    Designed for the Nexus 7 tablet; will need extended to support other
    devices.
  * bin/xedid: Add new script for viewing and installing EDID files into
    firmware.
    + Fixes situation where EDID is unavailable, corrupted, or invalid
      (LP: #575985)
    + Fixes situation where KVM corrupts the EDID the monitor provides.
      (LP: #992346)
  * bin/xpci: Fix two string issues so xpci will run.
    (LP: #1098390)
  * apport/source_xorg.py: Gracefully skip Xorg.0.log parsing if the
    parsing fails.
    (LP: #1098395)
  * apport/apport-gpu-error-intel.py: Gracefully skip DMI parsing if
    the parsing fails.
    (LP: #1062042)
  * xdiagnose/applet.py: Fix bug where a stray =1 gets added to
    GRUB_CMDLINE_LINUX_DEFAULT.
    (LP: #954123)
  * tests: Add sample Xorg.*.log files rather than using the on-disk one
 -- Bryce Harrington <email address hidden> Wed, 09 Jan 2013 18:17:24 -0800

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

Other bug subscribers

Bug attachments

Remote bug watches

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