I looked into some odd behavior with an OSG/Qt based application at
my place and traced this behavior back to an old favorite...

  osgviewerQT --QOSGWidget cow.osg

This crashes on some systems, runs fine on others.  This seems to be true
for both OSG versions 2.8.1-rc2 and 2.9.2, Qt version 4.4.3 .
We crash soon after we get a message:

  "OpenGL version test failed, requires valid graphics context."

Since there is no context glGetString returns NULL and we
crash in osg::<some class>::Extensions::setupGLExtensions.


Crashes on these systems:

ghanima - SUSE LINUX 10.0 (X86-64)
  Quadro FX 4500 / PCI / SSE2
  2.0.0  NVIDIA 76.67

bubba - Red Hat Enterprise Linux Client release 5 (Tikanga) X86-64
  Quadro FX 4500 / PCI / SSE2
  2.1.1  NVIDIA 100.14.19

cartman - Red Hat Enterprise Linux WS release 4 (Nahant)
  Quadro FX 3450/4000 SDI / PCI / SSE2
  2.0.0  NVIDIA 76.76


There is no problem with the same test on these systems:

dilbert - SUSE LINUX 10.1 (X86-64)
  Quadro FX 3400 / PCI / SSE2
  2.1.2  NVIDIA 180.29

jeckle - SUSE LINUX Enterprise Server 9 (x86_64)
  Quadro FX 1100 / APG / SSE2
  1.5.2  NVIDIA 66.29

curly - Red Hat Enterprise Linux WS release 4 (Nahant)
  FireGL V3100
  1.3.5140 (X4.3.0-8.14.13)

loki - Mac OS X 10.5.2
  NVIDIA GeForce 7300 GT OpenGL Engine
  2.0 NVIDIA-1.5.2

  With OSG_WINDOWING_SYSTEM=Carbon.  When OSG_WINDOWING_SYSTEM=X11
  the programs launches two windows, one with rendering, the other
  white with window controls.

(We haven't done a Windows build in a while, but had this examples
working once upon a time.)

Digging a bit deeper I found that glXMakeCurrent was failing, but
without setting any gl error code.  This was after glXCreateContext
returned a valid result.

If I make this change in QOSGWidget::createContext() ...

    // traits->inheritedWindowData = new WindowData(winId());
    traits->inheritedWindowData = NULL;

we no longer crash, but there are now two windows -- one live and one stale,
much like the version on Mac with OSG_WINDOWING_SYSTEM=X11.

A check of OpenGL doc indicated that there are legitimate reasons for
glXMakeCurrent and glXMakeContextCurrent return false without an error.  It
would seem likely that Qt is creating a Window that is rejected by
glXMakeCurrent some of the time.  I'm not familiar with Qt source enough to
debug that side of the problem.  Does this sound like I'm on the right track?
Anyone have a suggestion how to fix this on the OSG side?

-Don Leich


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to