prime-xconfig can write an invalid BusID string

Bug #1282796 reported by Daniel Dadap
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nvidia-prime (Ubuntu)
Fix Released
High
Alberto Milone
Precise
Fix Released
High
Alberto Milone

Bug Description

SRU request:

Please accept nvidia-prime (0.5~hybrid0.0.3) into precise-proposed.

[Rationale]
The fix .

[Impact]
Without this work, X will fail to start in some cases (see the "Full Explanation" section) on systems with hybrid graphics (Intel/NVIDIA).

[Test Case]
1) Install the update on a hybrid system with Intel/NVIDIA GPUs
2) Make sure that the system can boot and that X doesn't fail.

[Regression Potential]
Low. Thanks to this fix, the xorg.conf, if anything, will have greater chances to work.

[Full Explanation]
The BusID string created by prime-xconfig could be incorrect in any of the following cases:

a) Any numeric component of the bus ID is greater than 9: prime-xconfig will write a hexadecimal value, but X will parse it as decimal.
b) The system has more than one PCI domain: `lspci -Dn` will show the PCI domain, which is normally hidden on systems with a single PCI domain. This breaks the formatting assumptions made by nv_get_id() about which fields are in which position.

Besides the potential correctness issues, the generated BusID string is missing the following recommended (but optional) information:

a) Bus type. According to xorg.conf(5) this should be "PCI:"
b) PCI domain: omission of this field could lead to problems on systems with multiple PCI domains

A patch against nvidia-prime 0.5.5 from Trusty is attached. The version on github seems to be behind that version by quite a bit.

Revision history for this message
Daniel Dadap (ddadap) wrote :
Revision history for this message
Daniel Dadap (ddadap) wrote :

Note that X can parse hexadecimal values in the BusID string if they're prepended with "0x", since xf86ParsePciBusString() uses atoi(3) to parse each field; however, the comment at the top of xf86ParsePciBusString() explicitly states that a decimal value is expected.

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

The attachment "prime-xconfig: format the BusID string correctly" 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.]

tags: added: patch
Changed in nvidia-prime (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Tammy Yang (wanchingy) wrote :

Apply the patch (attach the testing package) and it works on Mondavi machine (BusID 0a:00.0 Nvidia GT840M is used).

Changed in nvidia-prime (Ubuntu):
status: New → Triaged
Changed in nvidia-prime (Ubuntu Precise):
status: New → Triaged
Changed in nvidia-prime (Ubuntu):
importance: Undecided → High
Changed in nvidia-prime (Ubuntu Precise):
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Changed in nvidia-prime (Ubuntu):
status: Triaged → In Progress
Changed in nvidia-prime (Ubuntu Precise):
status: Triaged → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

Thanks for the patch and for the explanation, Daniel!

Revision history for this message
Alberto Milone (albertomilone) wrote :

Also, the git branches are now up-to-date

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

This bug was fixed in the package nvidia-prime - 0.5.6

---------------
nvidia-prime (0.5.6) trusty; urgency=low

  [ Daniel Dadap ]
  * prime-xconfig:
    - Format the BusID string correctly (LP: #1282796).
      The BusID string created by prime-xconfig had several problems:
      1) It was missing the bus type "PCI", as recommended by
         xorg.conf(5).
      2) Values were written in hexadecimal, as reported by lspci,
         instead of decimal, as expected by the server. (See the
         comment at the top of xf86ParsePciBusString().)
      3) The PCI domain was not specified.
      Giving the BusID string in the wrong format could cause the X
      server to fail to parse the BusID, or to parse numbers in the
      wrong base. On systems with more than one PCI domain, `lspci -n`
      output would include the domain number, which is omitted by
      default on systems with only one PCI domain. nv_get_id()
      expects the bus number to be the first field, which would not be
      correct when `lspci -n` reports the domain, as it does on
      systems with multiple domains.
      Fix these issues by always reporting the domain with `lspci -Dn`
      and using it in the BusID string, prepending "PCI:" to the
      BusID string, and printing all numeric values in decimal.
 -- Alberto Milone <email address hidden> Fri, 21 Feb 2014 09:50:34 +0100

Changed in nvidia-prime (Ubuntu):
status: In Progress → Fix Released
Changed in nvidia-prime (Ubuntu Precise):
milestone: none → precise-updates
Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

hi!

Would it be argueable to have this SRU-backported to Precise 12.04.4 ?

Revision history for this message
Alberto Milone (albertomilone) wrote :

The SRU is for precise

tags: added: precise
Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

Excuse me, when will this arrive in Precise LTS?

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

I've checked even a few ubuntu-mirrors (status=uptodate). So it seems to be stuck somewhere?

Thanks in advance.

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

It's stuck in the upload-queue with priority=low

https://launchpad.net/ubuntu/precise/+queue?queue_state=0&queue_text=

Revision history for this message
Alberto Milone (albertomilone) wrote :

it hasn't been approved yet

Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

This is not true, because then it would appear in the unapproved queue:

https://launchpad.net/ubuntu/precise/+queue?queue_state=1&queue_text=

The package has not even been build yet...

I really think this is a quality issue with launchpad, if the bug appears here with importance= high why (in hell) this status doesn't get transferred accordingly?

So this bug got fixed in Trusty quite fast, but 5 days is a long time for users making an inappropriate experience with Ubuntu in an existing LTS.

I already got comments in the german Ubuntu-help forum: "Why does this works in Trusty, but not in Precise?"

Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Daniel, or anyone else affected,

Accepted nvidia-prime into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/nvidia-prime/0.5~hybrid0.0.3 in a few hours and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

description: updated
Changed in nvidia-prime (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
tags: added: hw-specific
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

After install from proposed it is works perfectly.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-prime - 0.5~hybrid0.0.3

---------------
nvidia-prime (0.5~hybrid0.0.3) precise-proposed; urgency=low

  [ Daniel Dadap ]
  * prime-xconfig:
    - Format the BusID string correctly (LP: #1282796).
      The BusID string created by prime-xconfig had several problems:
      1) It was missing the bus type "PCI", as recommended by
         xorg.conf(5).
      2) Values were written in hexadecimal, as reported by lspci,
         instead of decimal, as expected by the server. (See the
         comment at the top of xf86ParsePciBusString().)
      3) The PCI domain was not specified.
      Giving the BusID string in the wrong format could cause the X
      server to fail to parse the BusID, or to parse numbers in the
      wrong base. On systems with more than one PCI domain, `lspci -n`
      output would include the domain number, which is omitted by
      default on systems with only one PCI domain. nv_get_id()
      expects the bus number to be the first field, which would not be
      correct when `lspci -n` reports the domain, as it does on
      systems with multiple domains.
      Fix these issues by always reporting the domain with `lspci -Dn`
      and using it in the BusID string, prepending "PCI:" to the
      BusID string, and printing all numeric values in decimal.
 -- Alberto Milone <email address hidden> Fri, 21 Feb 2014 09:59:12 +0100

Changed in nvidia-prime (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for nvidia-prime has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

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.