graphics_driver crashed with NameError in hybrid_graphics_check(): global name 'hybrid' is not defined

Bug #1048058 reported by Dario Ruellan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
checkbox (Ubuntu)
Fix Released
Medium
Jeff Lane 

Bug Description

Hewlett-Packard HP Envy 14 1095la
https://wiki.ubuntu.com/druellan/hpenvy1095la

Checkbox raised this error on its own.

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: checkbox 0.14.4
ProcVersionSignature: Ubuntu 3.5.0-13.14-generic 3.5.3
Uname: Linux 3.5.0-13-generic i686
ApportVersion: 2.5.1-0ubuntu4
Architecture: i386
CasperVersion: 1.321
Date: Sat Sep 8 23:41:49 2012
ExecutablePath: /usr/lib/checkbox/bin/graphics_driver
InterpreterPath: /usr/bin/python3.2mu
LiveMediaBuild: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120905.2)
ProcCmdline: /usr/bin/python3 /usr/share/checkbox/scripts/graphics_driver
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.UTF-8
PythonArgs: ['/usr/share/checkbox/scripts/graphics_driver']
SourcePackage: checkbox
Title: graphics_driver crashed with NameError in hybrid_graphics_check(): global name 'hybrid' is not defined
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Related branches

Revision history for this message
Dario Ruellan (druellan) wrote :
tags: removed: need-duplicate-check
Changed in checkbox (Ubuntu):
importance: Undecided → Medium
Daniel Manrique (roadmr)
visibility: private → public
Revision history for this message
Daniel Manrique (roadmr) wrote :

This will happen on systems that report more than 1 graphics card (i.e. Hybrid systems with both drivers installed).

To reproduce:

- Copy /usr/share/checkbox/scripts/graphics_driver to /tmp
- Modify the copy on /tmp so that line 304 reads:

    has_hybrid_graphics = (len(cards) >= 1 and hybrid.is_laptop()

(the change is changing > for >= so that this condition is met on any system).

- Run the script from /tmp

Expected result:

- Graphics driver information

Actual result:

------------- VIDEO DRIVER INFORMATION -------------
Video Driver: intel
Driver Version: 2.17.0

------------- HYBRID GRAPHICS CHECK ----------------
Graphics Chipset: Intel (8086:0046)
Loaded DDX Drivers: intel, vesa, fbdev, fbdevhw
Traceback (most recent call last):
  File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 323, in <module>
    sys.exit(main())
  File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 318, in main
    results.append(hybrid_graphics_check(xlog))
  File "Documents/checkboxes/checkbox/trunk/scripts/graphics_driver", line 304, in hybrid_graphics_check
    has_hybrid_graphics = (len(cards) >= 1 and hybrid.is_laptop()
NameError: global name 'hybrid' is not defined

The problem is that the "hybrid" object on which is_laptop and cards_dict are being called does not exist. is_laptop() is just a method so it probably doesn't need to be scoped to hybrid, and cards_dict is a local variable in the hybrid_graphics_check method so it also probably needs no scoping.

Setting to Triaged with importance: Medium, as people running this on hybrid graphics systems (which are becoming more popular) will very likely run into this.

Changed in checkbox (Ubuntu):
status: New → Triaged
Jeff Lane  (bladernr)
Changed in checkbox (Ubuntu):
assignee: nobody → Jeff Lane (bladernr)
status: Triaged → In Progress
Revision history for this message
Jeff Lane  (bladernr) wrote :

Dario,

Thanks for reporting this. I must sheepishly admit that the fault here is all mine. When I wrote the script, I incorporated the hybrid code from a different script written by someone else. I neglected to change the bits that called a hybrid class object to work properly in my refactored version.

That being said, I think I have it fixed now, fairly simply... could you please run the attached modified script and report the results here? I do not have a machine with hybrid graphics. Fixing it to always report as you mention above (by changing line 304) does get me results with no traceback, but I'd feel better about it if I could see it run on an actual hybrid machine as well.

Thanks!

Jeff

Revision history for this message
Dario Ruellan (druellan) wrote :

Hi Jeff. My pleasure.
The script seems to work fine on my machine. Here's the output:

------------- VIDEO DRIVER INFORMATION -------------
Video Driver: intel
Driver Version: 2.20.3

------------- HYBRID GRAPHICS CHECK ----------------
Graphics Chipset: Intel (8086:0046)
Graphics Chipset: AMD (1002:68c1)
Loaded DDX Drivers: intel, ati, vesa, modesetting, fbdev
Hybrid Graphics: yes

Please, do not hesitate to contact me if you need anything else.

Revision history for this message
Jeff Lane  (bladernr) wrote :

Thanks! I've pushed the changes and requested a merge, so we should be able to get this fixed shortly. And thanks a lot for reporting this bug!

Changed in checkbox (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.14.7

---------------
checkbox (0.14.7) quantal; urgency=low

  * New upstream release (LP: #1057001)

  * Launchpad automated translation updates

  [Daniel Manrique]
  * jobs/audio.txt.in: replaced gconfaudiosink by autoaudiosink (LP: #978895)
  * scripts/audio_settings: Added exception handlers to catch problems with
    unwritable or absent settings files. jobs/audio.txt.in: Fixed unwritable
    setting files locations (LP: #1041644) (LP: #1041340)
  * Ensured that strings passed to qtiface.showError via dbus are strings,
    and not NoneType as could happen under certain circumstances.
    (LP: #1032337)
  * scripts/graphics_modes_info: updated shebang to python3 (LP: #1047515)
  * scripts/graphics_driver, scripts/color_depth_info: Added ignoring
    possible invalid characters in Xorg logfiles (LP: #1048096)

  [Matt Fischer]
  * scripts/network-device-info: fixed a problem with output causing a
    traceback and a problem where modules with improper modules field causes
    problems. jobs/networking.txt.in: added requires for pciutils for the
    above bugfix (LP: #1042395)

  [Sylvain Pineau]
  * jobs/suspend.txt.in: Fixed suspend/suspend_advanced dependencies to avoid
    calling fwts with the live CD (LP: #1045687)
  * qt/frontend/qtfront.ui: Fixed the test purpose widget size to allow two
    lines of description (LP: #1032255)
  * qt/frontend/qtfront.ui: Fixed the progressLabel widget size to support job
    names > 50 chars (LP: #1046274)

  [Brendan Donegan]
  * Make audio_settings before/after suspend tests more robust by not requiring
    every little audio setting to be the same before and after suspend, just
    the major ones such as the current source/sink and the mute/volume settings
    on them (LP: #1043144)
  * scripts/frequency_governors_test - Ensure that check for difference in
    expected and actual speedup only fails if the actual speedup is less than
    the expected speedup (LP: #999547)

  [Marc Tardif]
  * patch/0.14.2: Fixed patch to rmtree instead of rmdir scripts directory.
    (LP: #1047883)

  [Jeff Lane]
  * scripts/graphics_driver: fixed a bug causing the hybrid check to throw an
    exception on hybrid systems (LP: #1048058)
 -- Daniel Manrique <email address hidden> Tue, 25 Sep 2012 16:07:46 -0400

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

Other bug subscribers

Remote bug watches

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