I'm running into some troubles with my OpenGL application. Everytime my Mesa3D-libraries are updated (by Yum on my FC6-install), my application crashes in XQueryExtension.
I suspect that the libGL.so provided by my NVidia-drivers are overwritten by the Mesa ones, triggering the crash. However, in both cases I can run glxgears without crashing. Ultimately, I'd like to distribute compiled executables, so I would like to have my application work regardless if a user has the NVidia, ATI or Mesa libGL.so.
Does this problem sound familiar? How can I fix this crash?
Backtrace of the crash:
#0 0x0044a2c7 in XQueryExtension () from /usr/lib/libX11.so.6
#1 0x0043ec5b in XInitExtension () from /usr/lib/libX11.so.6
#2 0x0053b113 in XextAddDisplay () from /usr/lib/libXext.so.6
#3 0x00c770a2 in __glXFlushRenderBuffer () from /usr/lib/libGL.so.1
#4 0x00c779cf in __glXInitialize () from /usr/lib/libGL.so.1
#5 0x00c78afd in __glXSetupForCommand () from /usr/lib/libGL.so.1
#6 0x00c78bdf in glXMakeCurrentReadSGI () from /usr/lib/libGL.so.1
#7 0x00c790e3 in glXMakeCurrent () from /usr/lib/libGL.so.1
#8 0x005c62aa in GLXRenderContext::makeCurrent (this=0x916baa8)
at src/renderer/OpenGL/GLXRenderContext.cpp:129
Some of the init code:
XVisualInfo *visual = NULL;
// Try to get a double buffered visual
visual = glXChooseVisual(display, screen, attrListDbl);
if( visual == NULL )
{
// No double buffering, try single buffering
LOG_INFO( "No double buffering, trying single buffering" );
visual = glXChooseVisual(display, screen, attrListSgl);
}
if( visual == NULL )
throw RendererException( "No valid visual" );
m_renderContext = glXCreateContext( display, visual, NULL, GL_TRUE);
if( glXIsDirect(display, m_renderContext) )
LOG_INFO( "OpenGL: Using direct rendering" );
else
LOG_INFO( "OpenGL: Sorry no direct rendering possible" );
if( glXMakeCurrent(m_display, m_window, m_renderContext) == False )
throw RendererException( "Failed to make context current" );