Hi Robert

In your QT viewer example you have 5 statics scenes. A single viewer shows a 
single object and never changes: you update the widgets using a QTimer. 

Now, I have a dynamic system where the scene graph changes continuously and 
there is OsgOcean. I think that the QT problem is the next: If I change the 
scene graph tree when QT updates the viewer QGLWidget (paintGL() calls a new 
frame()), there is a race condition.

The chain is: 

1. I make osg tree scene changes.
2. I call the QWidget::update() which call the relative paintGL() slot.
3. paintGL() slot call the osg frame(). 

This slot (paintGL()) is asynchronous (means we have no garantees when the 
paintGL() comes...), so I can return to change the osg scene tree again even if 
the frame() (an "old" frame() call) is still in execution. I have tried to use 
a mutex but without luck at now.  The crash report is next: 


Code:
0x00007ffff06e1e5a in osg::Group::traverse(osg::NodeVisitor&) () from 
/usr/local/lib/libosg.so.80
(gdb) bt
#0  0x00007ffff06e1e5a in osg::Group::traverse(osg::NodeVisitor&) () from 
/usr/local/lib/libosg.so.80
#1  0x00007ffff211858c in osg::Group::accept(osg::NodeVisitor&) () from 
/usr/local/lib/libosgOcean.so
#2  0x00007fffef94f962 in osgViewer::Viewer::updateTraversal() () from 
/usr/local/lib/libosgViewer.so.80
#3  0x00007fffef958f62 in osgViewer::ViewerBase::frame(double) () from 
/usr/local/lib/libosgViewer.so.80
#4  0x00007ffff5d37633 in GfxViewer::paintGL() () from 
/usr/local/lib/libSimViewer.so
#5  0x00007fffefe3b450 in QGLWidget::glDraw() () from 
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#6  0x00007fffefe3ade9 in QGLWidget::paintEvent(QPaintEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#7  0x00007ffff6e3a802 in QWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8  0x00007fffefe3cc38 in QGLWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#9  0x00007ffff6deae9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff6def30a in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007ffff68c656e in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#12 0x00007ffff6e36524 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion 
const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff6fff68c in QWidgetPrivate::repaint_sys(QRegion const&) () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007ffff6e2b794 in QWidgetPrivate::syncBackingStore() () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007ffff6e3ae4c in QWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007fffefe3cc38 in QGLWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#17 0x00007ffff6deae9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff6def30a in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00007ffff68c656e in QCoreApplication::notifyInternal(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x00007ffff68ca3f1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, 
int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff68f4a63 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x00007ffff3e62ab5 in g_main_context_dispatch () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff3e62de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffff3e62ea4 in g_main_context_iteration () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff68f4bf6 in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007ffff6e8fc1e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x00007ffff68c52bf in 
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00007ffff68c5548 in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x00007ffff68ca708 in QCoreApplication::exec() () from 
/usr/lib/x86_64-linux-gnu/libQtCore.so.4

 


You can suggest to me some example to look, using QTViewer and dynamics scenes?

Thank you!

Cheers,
Dario

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54965#54965





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

Reply via email to