Bug in interaction between freeglut and mesa-7.3-rc2

Roderick Colenbrander thunderbird2k at gmx.net
Sat Jan 17 02:50:22 PST 2009


> >> The bug causes a segfault in libGL.so, though even with debug info
> >> enabled, I can't see the exact location. However, I can work around the
> >> bug when, in freeglut, I replace
> > Why would you do that?  There is no improvement to freeglut and no
> > benefit to its users.  If the read drawable and the drawing drawable are
> > always the same, just use glXMakeCurrent.  You already have a tool that
> > does *exactly* the job you need done.  Why change to a tool that is
> > intended to suit a different need?
> Uh, I do that because I need to use freeglut with the opensource drivers 
> and DRI? It won't work otherwise. Note: freeglut currently contains 
> _glxMakeContextCurrent_, which I replaced by _glXMakeCurrent_, not the 
> other way round.
> 
> If I remember correctly, I already posted this patch to the freeglut 
> mailing list last fall, where it was rejected, citing possible side 
> effects on other platforms. As I am not a regular freeglut developer, I 
> accepted that and (wrongly) concluded that it has to be fixed in Mesa.
> 
> So let me summarize:
> - there is a bug in Mesa which causes glxMakeContextCurrent to segfault,
> - but it only occurs because freeglut doesn't call glXMakeCurrent, as it
>    really should, and passes invalid parameters, too.
> 
> If that is correct, could somebody with more authority than me 
> please convince the freeglut guys to fix it? As freeglut is the default
> GLUT 
> implementation on most distros, I consider this quite important for 
> acceptance of the opensource DRI drivers.. a _lot_ of software uses GLUT, 
> and consequently crashes.
> 
> Yours, Florian
> -- 
> "_Nothing_ brightens up my morning. Coffee simply provides a shade of
> grey just above the pitch-black of the infinite depths of the _abyss_."
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg

As mentioned before it is not a Mesa bug at all. It is just freeglut which makes GLX 1.3 calls which it shouldn't if the GLX version is not 1.3. If the client GLX version is 1.3 you can't expect that functions such as glXMakeContextCurrent work as expected as their end-result is undefined. Depending on the driver implementation it could crash or just work. Since glut is a relatively simple API I doubt it has use for this call except for purposes like pbuffer/pixmap rendering if it supports that but as far as I remember it doesn't.

Roderick
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a



More information about the xorg mailing list