source_xorg.py crashed with ValueError in attach_graphic_card_pci_info(): need more than 1 value to unpack

Bug #844733 reported by Chris Bainbridge
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NULL Project
Invalid
Undecided
Unassigned
xdiagnose
Fix Released
High
Unassigned

Bug Description

run apport-bug
click on "I can reproduce this bug"
get following error and dumped back to dialog:

ERROR: hook /usr/share/apport/package-hooks//xserver-xorg-core.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 639, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/package-hooks//xserver-xorg-core.py", line 653, in add_info
    attach_graphic_card_pci_info(report, ui)
  File "/usr/share/apport/package-hooks//xserver-xorg-core.py", line 341, in attach_graphic_card_pci_info
    key, value = line.split(': ', 1)
ValueError: need more than 1 value to unpack

Tags: oneiric patch

Related branches

summary: oneiric hook /usr/share/apport/package-hooks//xserver-xorg-core.py crash
- ValueError: need more than 1 value to unpacked
+ ValueError: need more than 1 value to unpack
Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote : Re: oneiric hook /usr/share/apport/package-hooks//xserver-xorg-core.py crash ValueError: need more than 1 value to unpack

     for paragraph in display_pci.split('\n\n'):
        for line in paragraph.split('\n'):
            if ':' not in line:
                continue
            key, value = line.split(': ', 1)
            value = value.strip()
            key = key.strip()

The ValueError occurs on the line
    key, value = line.split(': ', 1)

The problem is line.split returns ['\t\tDevCap:\tMaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited']
Note :\t is not matched by the split on ': '

Fix:

--- /usr/share/apport/package-hooks/xserver-xorg-core.py.orig 2011-09-14 03:00:44.392362002 +0100
+++ /usr/share/apport/package-hooks/xserver-xorg-core.py 2011-09-14 03:01:52.102362002 +0100
@@ -338,7 +338,10 @@
         for line in paragraph.split('\n'):
             if ':' not in line:
                 continue
- key, value = line.split(': ', 1)
+ m = re.match(r'(.*?):\s(.*)', line)
+ if not m:
+ continue
+ key, value = m.group(1), m.group(2)
             value = value.strip()
             key = key.strip()
             if "VGA compatible controller" in key:

Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

Formatting..

tags: added: oneiric
tags: added: patch
Revision history for this message
Chris Bainbridge (chris-bainbridge) wrote :

This is still a problem with xdiagnose-1.2. The crash only happens when xserver-xorg-core.py is run as root:

$ sudo /usr/share/apport/package-hooks/xserver-xorg-core.py
 lsb_release -sc
attach_gpu_hang_info
attach_xorg_package_versions
attach_dist_upgrade_status
attach_hardware
attach_graphic_card_pci_info
Traceback (most recent call last):
  File "/usr/share/apport/package-hooks/xserver-xorg-core.py", line 680, in <module>
    if not add_info(report, None):
  File "/usr/share/apport/package-hooks/xserver-xorg-core.py", line 653, in add_info
    attach_graphic_card_pci_info(report, ui)
  File "/usr/share/apport/package-hooks/xserver-xorg-core.py", line 341, in attach_graphic_card_pci_info
    key, value = line.split(': ', 1)
ValueError: need more than 1 value to unpack

summary: - oneiric hook /usr/share/apport/package-hooks//xserver-xorg-core.py crash
- ValueError: need more than 1 value to unpack
+ source_xorg.py crashed with ValueError in
+ attach_graphic_card_pci_info(): need more than 1 value to unpack
Martin Pitt (pitti)
affects: apport → null
Changed in null:
status: New → Invalid
Bryce Harrington (bryce)
Changed in xdiagnose:
importance: Undecided → High
status: New → Fix Committed
Robert Hooker (sarvatt)
Changed in xdiagnose:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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