apport hook AssertionError in __setitem__ when trying to assign None value

Bug #710630 reported by Marco Rodrigues
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Fix Released
High
Bryce Harrington

Bug Description

Binary package hint: xorg

After dist-upgrade from Maverick to Natty.

$ ubuntu-bug fglrx
hook /usr/share/apport/package-hooks//source_fglrx-installer.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 636, in add_hooks_info
    symb['add_info'](self, ui)
  File "/usr/share/apport/package-hooks//source_fglrx-installer.py", line 428, in add_info
    attach_3d_info(report, ui)
  File "/usr/share/apport/package-hooks//source_fglrx-installer.py", line 324, in attach_3d_info
    '/usr/lib/nux/unity_support_test'])
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 500, in __setitem__
    and (hasattr(v[0], 'isalnum') or hasattr(v[0], 'read'))))
AssertionError

Tags: natty

Related branches

tags: added: natty
Revision history for this message
Bryce Harrington (bryce) wrote :

Brian saw similar error reporting for compiz:
https://pastebin.canonical.com/42676/

However running unity_support_test directly doesn't cause a crash. Not sure exactly what's going on, maybe we should add a try/catch around that for now.

Changed in xorg (Ubuntu):
assignee: nobody → Bryce Harrington (bryce)
importance: Undecided → High
status: New → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :

This works fine:

In [9]: report['UnitySupportTest'] = command_output(['/usr/lib/nux/unity_support_test', '-p'])

In [10]: report['UnitySupportTest']
Out[10]: '\x1b[0;38;48mNux: ---------------------------\x1b[0;38;48m\n\x1b[0;38;48mNux: Device pci id detection ...\x1b[0;38;48m\n\x1b[0;38;48mNux: ---------------------------\x1b[0;38;48m\n\x1b[1;32;48mNux: lspci: 01:00.0 VGA compatible controller [0300]: ATI Technologies Inc RV730 PRO [Radeon HD 4650] [1002:9498]\n\x1b[0;38;48m\n\x1b[1;32;48mNux: PCI [vendor:device]: [1002:9498]\x1b[0;38;48m\n\x1b[1;32;48mNux: Device Id: 0x1002\x1b[0;38;48m\n\x1b[1;32;48mNux: Vendor Id: 0x9498\x1b[0;38;48m\n\x1b[0;38;48mNux: ------------------------\x1b[0;38;48m\n\x1b[0;38;48mNux: Graphics device info ...\x1b[0;38;48m\n\x1b[0;38;48mNux: ------------------------\x1b[0;38;48m\n\x1b[0;38;48mNux: ------------------------\x1b[0;38;48m\n\x1b[0;38;48mNux: OpenGL version check ...\x1b[0;38;48m\n\x1b[0;38;48mNux: ------------------------\x1b[0;38;48m\n\x1b[1;32;48mNux: System OpenGL: 2.1 [Minimum Required 1.4]\x1b[0;38;48m\n\x1b[0;38;48mNux: -------------------_------\x1b[0;38;48m\n\x1b[0;38;48mNux: OpenGL extension check ...\x1b[0;38;48m\n\x1b[0;38;48mNux: --------------------------\x1b[0;38;48m\n\x1b[1;32;48mNux: Frame Buffer Object support: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: ARB Vertex Program: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: ARB Fragment Program: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: Non Power Of Two Textures: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: Rectangle Texture: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: Vertex Buffer Object: YES\x1b[0;38;48m\n\x1b[1;32;48mNux: Pixel Buffer Object: YES\x1b[0;38;48m\n\x1b[0;38;48mNux: ---------------------------\x1b[0;38;48m\n\x1b[0;38;48mNux: Unity support assesment ...\x1b[0;38;48m\n\x1b[0;38;48mNux: ---------------------------\x1b[0;38;48m\n\x1b[1;32;48mNux: The system can run Unity.\x1b[0;38;48m'

so it is probably something in the __setitem__ funciton of problem_report.py of apport. It'd also be good if unity_support_test had a switch made it not use colors.

Looking at the output of unity_support_test perhaps only the last line is relevant?

Revision history for this message
Bryce Harrington (bryce) wrote : Re: [Bug 710630] Re: fglrx apport hook AssertionError in __setitem__

On Wed, Feb 02, 2011 at 11:36:49PM -0000, Brian Murray wrote:
> Looking at the output of unity_support_test perhaps only the last line
> is relevant?

I assume in cases where the last line doesn't indicate that unity is
supported, they'd like to see the full details.

But I agree the color code stuff is ugly and should go.

If/when I ever get a few spare days I want to try to clean up the
integration of this script into the apport hook; it seems to have a
variety of problems.

Revision history for this message
Brian Murray (brian-murray) wrote : Re: fglrx apport hook AssertionError in __setitem__

As an interim solution this works around the issue and adds the data:

            ust = command_output_quiet(['/usr/lib/nux/unity_support_test',
                '-p'])
            ust = ust.replace('\x1b','').replace('[0;38;48m','').replace('[1;32;48m','')
            report['UnitySupportTest'] = ust

Revision history for this message
Bryce Harrington (bryce) wrote :

This issue may be worth putting in for alpha-2

Revision history for this message
Bryce Harrington (bryce) wrote :

I've pushed the fix (along with a try/except block to be extra sure) to git.
Checking with Kate about possible inclusion in alpha-2.

Revision history for this message
Bryce Harrington (bryce) wrote :

The consequence of this bug is it makes it harder for people to report bugs against compiz (and maybe xorg). Since the purpose of the alpha-2 release is specifically for testing, particularly of Unity, this seems worth it to me to include.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg - 1:7.6~3ubuntu3

---------------
xorg (1:7.6~3ubuntu3) natty; urgency=low

  * apport/source_xorg.py:
    - Tag bugs with compiz version
    - Trim out colored output from unity_support_test, which causes apport
      to choke when reporting compiz bugs.
      (LP: #710630)
 -- Bryce Harrington <email address hidden> Wed, 02 Feb 2011 16:03:57 -0800

Changed in xorg (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I just got to see the (kind of) duplicate bug 716143. This assertion

    and (hasattr(v[0], 'isalnum') or hasattr(v[0], 'read'))))

would hit if the value that gets passed is neither a string nor a file object. In particular, it would error out like this if you try to pass "None".

This can happen if the command you are calling produces an error:

def command_output_quiet(command_list):
    '''
    On errors, quell error message and just return empty string
    '''
    log = command_output(command_list)
    if log[:5] == "Error":
        return None
    return log

[...]

                ust = command_output_quiet([
                    '/usr/lib/nux/unity_support_test', '-p'])
                #ust = ust.replace('\x1b','').replace('[0;38;48m','').replace('[1;32;48m','')
                report['UnitySupportTest'] = ust

I. e. if the command produces any error, ust is None, and the assignment to the report dictionary fails. Some invocations of command_output_quiet are guarded with an if, some others call programs which really Should Not Fail (tm), so these are probably okay.

I think the best approach here is to use command_output(), as we really want to know about the actual error if unity_support_test fails.

Changed in xorg (Ubuntu):
status: Fix Released → Triaged
summary: - fglrx apport hook AssertionError in __setitem__
+ apport hook AssertionError in __setitem__ when trying to assign None
+ value
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg - 1:7.6~3ubuntu9

---------------
xorg (1:7.6~3ubuntu9) natty; urgency=low

  * apport/source_xorg.py:
    - Collect jockey info in the case of proprietary drivers
    - Collect update-alternatives info in case of proprietary drivers
    - Generate nvidia-bug-report.log.gz if -nvidia loaded
    - Don't quell errors calling unity_support_test (LP: #710630)
    - Check for null when checking for upgrades. Can fail if apt.log is
      empty or unreadable. (LP: #723061)
 -- Bryce Harrington <email address hidden> Tue, 01 Mar 2011 16:58:31 -0800

Changed in xorg (Ubuntu):
status: Triaged → 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.