Nux

Merge lp:~unity-team/nux/nux-fix-810182 into lp:nux/2.0

Proposed by Jay Taoko
Status: Merged
Approved by: Jay Taoko
Approved revision: 522
Merged at revision: 522
Proposed branch: lp:~unity-team/nux/nux-fix-810182
Merge into: lp:nux/2.0
Diff against target: 25 lines (+13/-2)
1 file modified
tools/unity_support_test.c (+13/-2)
To merge this branch: bzr merge lp:~unity-team/nux/nux-fix-810182
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+83057@code.launchpad.net

Description of the change

Many of the duplicates in bug #810182, report errors with loading of GLX.
         extension "GLX" missing on display ":0".
         Xlib: extension "GLX" missing on display ":0".
         Xlib: extension "GLX" missing on display ":0".

Many of the Xorg logs also report error in loading of the Nvidia or Nouveau driver. I will add a test to detect the presence of GLX on the system. If the system does not have GLX support, then unity_support_test will not continue further and the test will fail (but not crash).

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Hi Jay,

I'd keep the display check first, that way you don't have to check it multiple
times.

Instead of the explicit checks, can we just use !?

  if (!display || !glx_supported) {
    if (!display)
      results.error = strdup ("unable to open display");
...

But the code looks sound.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

Do we have hardware in the QA lab we can use to test this I wonder?

Revision history for this message
Tim Penhey (thumper) wrote :

Are there any tests around this now?

Revision history for this message
Jay Taoko (jaytaoko) wrote :

> Hi Jay,
>
> I'd keep the display check first, that way you don't have to check it multiple
> times.
>
> Instead of the explicit checks, can we just use !?
>
> if (!display || !glx_supported) {
> if (!display)
> results.error = strdup ("unable to open display");
> ...

Will do.

> But the code looks sound.

The fix here is meant to do something that must be done before the program can continue. The program is using GLX without testing that it is available on the system. In this case, there is no need for a test. Or rather the "opposite test" is that the programs crashes when we do not check for GLX, as evidenced by the bug reports.

lp:~unity-team/nux/nux-fix-810182 updated
522. By Jay Taoko

* Minor fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/unity_support_test.c'
--- tools/unity_support_test.c 2011-10-14 16:36:25 +0000
+++ tools/unity_support_test.c 2011-11-24 16:50:17 +0000
@@ -720,8 +720,19 @@
720720
721 // Open a X11 connection and get the root window.721 // Open a X11 connection and get the root window.
722 display = XOpenDisplay (display_name);722 display = XOpenDisplay (display_name);
723 if (display == NULL) {723
724 results.error = strdup ("unable to open display");724 // Before doing anything with GLX, check that it is supported on the system.
725 Bool glx_supported = False;
726 int dummy0, dummy1;
727 if (display)
728 glx_supported = glXQueryExtension(display, &dummy0, &dummy1);
729
730 if (!display || !glx_supported) {
731 if (!display)
732 results.error = strdup ("unable to open display");
733 else
734 results.error = strdup ("GLX is not available on the system");
735
725 // exit with 5, to tell "it's not an error we should cache"736 // exit with 5, to tell "it's not an error we should cache"
726 results.result = 5;737 results.result = 5;
727 }738 }

Subscribers

People subscribed via source and target branches

to all changes: