hybrid-detect does not correctly detect if an alternative for the respective driver cannot be found

Bug #1061587 reported by linuxball
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-common (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04

$ apt-cache policy nvidia-common
nvidia-common:
  Installed: 1:0.2.44.2
  Candidate: 1:0.2.44.2
  Version table:
 *** 1:0.2.44.2 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:0.2.44 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

Hardware:
  LENOVO ThinkPad T520 (Type: 4240-6AG) with Nvidia Optimus technology
  BIOS Setup -> Config -> Display -> OS Detection for NVIDIA Optimus: [Disabled]

Expected behavior:

  If "BIOS Setup -> Config -> Display -> Graphics Device" was changed from "Integrated Graphics" [Intel Sandybridge Mobile (GT2+)] to "Discrete Graphics" (NVIDIA NVd9) then hybrid-detect should look for the master link of an alternative for the "i386-linux-gnu_gl_conf"/"x86_64-linux-gnu_gl_conf" nvidia driver and set the respective link using "update-alternatives". If an alternative cannot be found (e.g. because no nvidia driver is installed and the nouveau driver is used instead) then hybrid-detect should not call "update-alternatives --set <arch-prefix>_gl_conf" without path argument and write an error message to stderr:

  Gfx was changed in the BIOS
  Error: no alternative found

Actual behavior for i386 package architecture:

  In the above reported case hybrid-detect calls "update-alternatives --set <arch-prefix>_gl_conf" with the path argument missing. The respective log output in /var/log/upstart/hybrid-gfx.log is:

  Gfx was changed in the BIOS
  Select
  update-alternatives: --set needs <name> <path>

  Usage: update-alternatives [<option> ...] <command>

  [ rest of usage output removed ]

Fix:

  Because hybrid-detect does not check for an empty string in line 207 (only for a NULL pointer) after calling get_alternative_link() it does not detect if an alternative was not found. The attached patch, which will add the empty string detection will fix this problem.

Tags: patch
Revision history for this message
linuxball (linuxball) wrote :

This (corrected) patch fixes the reported problem.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix for the reported problem" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
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.