William A. Hoffman wrote:
> Hi,  we have found an issue with mesa 6.5 and CVS mesa.
> It seems that creating a context, then deleting it,
> then creating a new one causes a crash.
> 
> Here is a simple VTK example:
> vtkRenderWindow ren
> ren Render
> ren Delete
> 
> vtkRenderWindow ren
> ren Render
> ren Delete
> 
> 
> We have also created a minimum glx/X/GL code from VTK that demonstrates the 
> problem. 
> It does not crash but exits with
> 
> 
> X Error of failed request:  BadValue (integer parameter out of range for 
> operation)
>   Major opcode of failed request:  78 (X_CreateColormap)
>   Value in failed request:  0xff00
>   Serial number of failed request:  8
>   Current serial number in output stream:  13
> 
> 
> However, running the executable in valgrind produces the following:
> 
> 
> ==25222== Invalid read of size 4
> ==25222==    at 0x40264806: XSync (in /usr/X11R6/lib/libX11.so.6.2)
> ==25222==    by 0x405E5E94: XMesaGarbageCollect (xm_api.c:2570)
> ==25222==    by 0x405E2166: Fake_glXCreateContext (fakeglx.c:1301)
> ==25222==    by 0x405E17AE: glXCreateContext (glxapi.c:167)
> ==25222==    by 0x80492DA: vtkWindow::CreateAWindow() (test.cxx:259)
> ==25222==    by 0x804941E: vtkWindow::Render() (test.cxx:75)
> ==25222==    by 0x8048D8D: main (test.cxx:103)
> ==25222==  Address 0x420FB53C is 1232 bytes inside a block of size 1336 free'd
> ==25222==    at 0x4002857D: free (vg_replace_malloc.c:186)
> ==25222==    by 0x4025A3BD: _XFreeDisplayStructure (in 
> /usr/X11R6/lib/libX11.so.6.2)
> ==25222==    by 0x402477C5: XCloseDisplay (in /usr/X11R6/lib/libX11.so.6.2)
> ==25222==    by 0x8048EF3: vtkWindow::Destroy() (test.cxx:143)
> ==25222==    by 0x80493E4: vtkWindow::~vtkWindow() (test.cxx:34)
> ==25222==    by 0x8048D53: main (test.cxx:98)
> ==25222==
> ...
> 
> 
> This happens when the second context is created. This is also exactly where 
> VTK crashes.

The problem is when XCloseDisplay() is called some Mesa data 
structures associated with the display aren't being freed.  Later, 
things blow up when stale Display * pointers are dereferenced.

I've got a solution though.  I've written some new code so that Mesa 
plugs itself into Xlib as an X extension.  This allows Mesa to be 
notified when XCloseDisplay gets called so we can clean up everything 
that depends on the display.

I'm checking in the code now.

-Brian

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to