Bug 656308 - segfault in libGL when try to open dual screens (xlockmore, glxinfo, etc)
Summary: segfault in libGL when try to open dual screens (xlockmore, glxinfo, etc)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: 15
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-23 13:15 UTC by Ian Collier
Modified: 2012-08-07 19:25 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-08-07 19:25:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
A test program which demonstrates the crash (1.66 KB, text/x-csrc)
2010-11-23 13:15 UTC, Ian Collier
no flags Details
Backtrace from running the test program in gdb (2.54 KB, text/plain)
2010-11-23 13:20 UTC, Ian Collier
no flags Details
output from glxinfo (20.17 KB, text/plain)
2010-11-23 16:02 UTC, Ian Collier
no flags Details

Description Ian Collier 2010-11-23 13:15:52 UTC
Created attachment 462324 [details]
A test program which demonstrates the crash

Description of problem:
xlock crashes when any GL mode is started.  Also, glxinfo crashes in the same place, namely drisw_glx.c:94.  This happens on a display with two logical screens.  I am attaching a small test program which also exhibits the same behaviour.

Version-Release number of selected component (if applicable):
mesa-libGL-7.9-2.fc14.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Configure X to have two logical screens (i.e., not using XRANDR)
2. xlock -mode pipes
2b. glxinfo
  
Actual results:
Segmentation fault

Expected results:
No segmentation fault

Additional info:

In the test program (based on what xlock does to cause the crash), 0x103 and 0x1C0 are the visuals that xlock chooses (by what method I'm not sure).  They exist as verified by running:
$ xdpyinfo|egrep '0x103|0x1c0'
    visual id:    0x103
    visual id:    0x1c0
on each screen, and as verified by the non-NULL return of XGetVisualInfo.  However, the second call to glXMakeCurrent segfaults in the fuction XCreateDrawable because the call
  pdp->visinfo = XGetVisualInfo(dpy, visMask, &visTemp, &num_visuals);
on line 91 of drisw_glx.c returns NULL and this is not checked before being dereferenced in line 94.  (Whether the bug is that it returns NULL or that it isn't checked, I don't know.)

Comment 1 Ian Collier 2010-11-23 13:20:29 UTC
Created attachment 462327 [details]
Backtrace from running the test program in gdb

Comment 2 Adam Jackson 2010-11-23 15:27:25 UTC
Can you attach the full output from glxinfo?

Comment 3 Ian Collier 2010-11-23 16:02:29 UTC
Created attachment 462372 [details]
output from glxinfo

When run on :0.1 it does this:

$ glxinfo
name of display: :0.1
Segmentation fault (core dumped)

visTemp at the time of the crash has screen=1 and visualid=0xf9

When run on :0.0 it produces more output (attached).
visTemp at the time of the crash has screen=0 and visualid=0x1b6

It looks in fact like both of these are invalid (xdpyinfo lists 0xf9 on screen 0 and 0x1b6 on screen 1.  But the values used by the test program are valid visuals (0x103 on screen 0 and 0x1c0 on screen 1).  So the two crashes may have different causes despite crashing at the same line of code.

Comment 4 Ian Collier 2010-11-23 16:48:34 UTC
No, my mistake - the two crashes are the same.  The value of visTemp.screen when the program crashes is not the same as the screen that was asked for.  In fact on line 88 of drisw_glx.c it's set to the default screen.  Therefore, if the default screen is not the one that contains the requested visual, it will fail to find the visual and thus crash.

So it turns out I've always been running the test program on :0.0.  It asks for screen 0 visual 0x103, which succeeds, and then screen 1 visual 0x1c0, which crashes with visTemp.screen set to 0.

But if I run it on :0.1, it crashes on the first request (for visual 0x103) with visTemp.screen set to 1.

Comment 5 Adam Jackson 2012-01-03 19:46:00 UTC
Think I finally found the issue here.  If you don't mind testing a patch:

http://lists.freedesktop.org/archives/mesa-dev/2012-January/016792.html

Otherwise I'll just roll that into a mesa update once it's approved upstream.

Comment 6 Fedora End Of Life 2012-08-07 19:25:53 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.