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:
0x706e1e5a in osg::Group::traverse(osg::NodeVisitor&) () from
/usr/local/lib/libosg.so.80
(gdb) bt
#0 0x706e1e5a in osg::Group::traverse(osg::NodeVisitor&) () from
/usr/local/lib/libosg.so.80
#1 0x7211858c in osg::Group::accept(osg::NodeVisitor&) () from
/usr/local/lib/libosgOcean.so
#2 0x7fffef94f962 in osgViewer::Viewer::updateTraversal() () from
/usr/local/lib/libosgViewer.so.80
#3 0x7fffef958f62 in osgViewer::ViewerBase::frame(double) () from
/usr/local/lib/libosgViewer.so.80
#4 0x75d37633 in GfxViewer::paintGL() () from
/usr/local/lib/libSimViewer.so
#5 0x7fffefe3b450 in QGLWidget::glDraw() () from
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#6 0x7fffefe3ade9 in QGLWidget::paintEvent(QPaintEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#7 0x76e3a802 in QWidget::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8 0x7fffefe3cc38 in QGLWidget::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#9 0x76deae9c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x76def30a in QApplication::notify(QObject*, QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x768c656e in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#12 0x76e36524 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion
const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x76fff68c in QWidgetPrivate::repaint_sys(QRegion const&) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x76e2b794 in QWidgetPrivate::syncBackingStore() () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x76e3ae4c in QWidget::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x7fffefe3cc38 in QGLWidget::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#17 0x76deae9c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x76def30a in QApplication::notify(QObject*, QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x768c656e in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#20 0x768ca3f1 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x768f4a63 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#22 0x73e62ab5 in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x73e62de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x73e62ea4 in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x768f4bf6 in
QEventDispatcherGlib::processEvents(QFlags) ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x76e8fc1e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x768c52bf in
QEventLoop::processEvents(QFlags) () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x768c5548 in
QEventLoop::exec(QFlags) () from
/usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x768ca708 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org