gpu-manager: get_alternative_link() NEVER checks for a correct alternative
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-drivers-common (Ubuntu) |
Fix Released
|
High
|
Alberto Milone | ||
Xenial |
Fix Released
|
High
|
Alberto Milone |
Bug Description
SRU Request:
[Impact]
The current code will prevent gpu-manager from getting the correct list of alternatives. This breaks the detection system.
[Test Case]
Install the nvidia driver and check that gpu-manager reconfigures the system properly. More specifically, there should be no "Error: no alternative found for nvidia" line in /var/log/
[Regression Potential]
Low, it is a one line change and a pretty obvious fix.
_______
I suppose this is a fairly significant bug, since it renders gpu-manager virtually useless.
I found it in ubuntu-
-- Symptoms --
For some reason, on my machine I frequently insert and remove my nvidia graphics adapter. My processor has an intel HD graphics adapter as well, so I rely on gpu-manager to detect my hardware configuration during boot, and update alternatives appropriately.
However, since I upgraded to Ubuntu 16.04, reconfiguring my hardware makes me unable to boot to desktop. However, reverting to previous hardware configuration solves the issue.
-- Analysis and proposed solution --
A quick check of symbolic links at /etc/ld.
Error: no alternative found for nvidia
Warning: no EGL alternative found for nvidia
Further investigation shows that the problem is with the get_alternative
The get_alternative
For example, when looking for "gl" alternatives for architecture "x86_64-linux-gnu", the resulting command will be:
update-
This command always returns an empty list, and that is correct. The command is clearly malformed, the intention was to run another command, namely:
update-
(note the order of "gl" vs "x86_64_linux_gnu")
Indeed the `snprintf` used to prepare the command has it's arguments swapped. Therefore I propose to substitute the mentioned source code with:
Applying the proposed change reliably fixes the bug symptoms I experienced.
-- Additional comment --
For your convenience, I attached to this bug report a patch file that applies the proposed solution; the patch is intended for ubuntu-
As far as I can tell, due to these swapped arguments gpu-manager always looks for unexisting alternatives, and therefore there is no scenario in which it would correctly configure alternatives. I suppose in this case gpu-manager always fails to serve its purpose. I find it astonishing that nobody noticed this issue yet.
Changed in ubuntu-drivers-common (Ubuntu): | |
assignee: | nobody → Alberto Milone (albertomilone) |
Changed in ubuntu-drivers-common (Ubuntu): | |
status: | Triaged → In Progress |
Changed in ubuntu-drivers-common (Ubuntu Xenial): | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in ubuntu-drivers-common (Ubuntu): | |
importance: | Critical → High |
Changed in ubuntu-drivers-common (Ubuntu Xenial): | |
assignee: | nobody → Alberto Milone (albertomilone) |
description: | updated |
The attachment "fix_alternativ e_argument_ order.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]