[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#621780: glxinfo SEGV with multiple screens



So, I narrowed it down with gdb.  The problem is, glxinfo loops through
all 3 screens of my display - but it crashes if the screen is not the
default screen (the .N in $DISPLAY).  I don't yet know _why_ it
crashes.  I'm attaching a patch that works around it, by _not_ looping
through all screens, but just getting info on the screen in $DISPLAY.
It's good enough for my use, but it's really just a workaround, so I'm
not adding a 'patch' tag.

> >     :0.0 xserver-xorg-video-nouveau    1:0.0.16+git20101210+8bb8231-2+exp2
> >     :0.1 xserver-xorg-video-radeon     1:6.14.0-1+exp2
> >     :0.2 xserver-xorg-video-nouveau    1:0.0.16+git20101210+8bb8231-2+exp2
> 
> (Out of curiosity, how did you configure that setup?)

Nothing very interesting.  3 simple "Device" and "Screen" sections, then:

    Section "ServerLayout"
        Identifier	"Default Layout"
        Screen          "S-nv0"
        Screen		"S-r0" RightOf "S-nv0"
        Screen		"S-nv1" RightOf "S-r0"
    EndSection

Anyway, workaround patch attached.  I might try to do more at some
point (build mesa from git, find the real bug, report upstream), though
I'm too busy at the moment.

Peter
--- mesa-demos-8.0.1/src/xdemos/glxinfo.c
+++ mesa-demos-8.0.1/src/xdemos/glxinfo.c
@@ -1197,7 +1197,6 @@
 {
    char *displayName = NULL;
    Display *dpy;
-   int numScreens, scrnum;
    InfoMode mode = Normal;
    GLboolean findBest = GL_FALSE;
    GLboolean limits = GL_FALSE;
@@ -1248,9 +1247,8 @@
       printf("%d\n", b);
    }
    else {
-      numScreens = ScreenCount(dpy);
+      int scrnum = DefaultScreen(dpy);
       print_display_info(dpy);
-      for (scrnum = 0; scrnum < numScreens; scrnum++) {
          mesa_hack(dpy, scrnum);
          print_screen_info(dpy, scrnum, allowDirect, limits);
          printf("\n");
@@ -1258,9 +1256,6 @@
 #ifdef GLX_VERSION_1_3
          print_fbconfig_info(dpy, scrnum, mode);
 #endif
-         if (scrnum + 1 < numScreens)
-            printf("\n\n");
-      }
    }
 
    XCloseDisplay(dpy);

Reply to: