[osg-users] [Crash issue] How to add&remove drawable (geometry) property.

Robert Osfield robert.osfield at gmail.com
Thu Jul 26 06:36:26 PDT 2018


Hi Jinh,

First thing I would try is to run your application single threaded.
If this fixes the crash then it would indicate a threading issue with
how you are going about adding/remove elements of the scene graph.

You don't describe any of details of what threads are doing what so I
can't speculate any further as to what you might be doing wrong.  As a
general guide, the OSG is designed for the main scene graph to be
updated only in the update and event phases/traversals where the scene
graph itself is being traversed single threaded.

Robert.
On Thu, 26 Jul 2018 at 14:14, Jinh Tang <peter.wang1013 at gmail.com> wrote:
>
> Hi,
> I am doing them real-time rendering application development with Qt + OSG.
> I created several threads to create new Geometry and in GUI - main threads, try to remove the old one and add new ones.
>
> 1, already set node and geometry to user dynamic.
>      geometry->setDataVariance(osg::Object::DYNAMIC)
>      geode_->setDataVariance(osg::Object::DYNAMIC);
> 2,  already used osg smart point everywhere.
> 3,  geometry is created in other threads. and post to a global queue.
> 4, in Main thread. PaintGL event will add&remove geometry in "autoAddRemove" function.
>         void OSGMeshRender::paintGL() {
>             autoAddRemove();
>             viewer_->frame();
>        }
> 5,  the setup work for qt+osg is almost same like this blog, nothing speical.
>   vicrucann.github.io/tutorials/cmake-qt-osg-1/
>
>
> I got below crash sometimes when I add&remove drawable.
>
> 0000082`873ba218 : nvoglv64+0x927b51
> 00000075`2b19bf61 : osg156_osgrd!osg::GLBufferObject::deleteGLObject+0x69 [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 253]
> 00000075`2b19bf61 : osg156_osgrd!osg::GLBufferObjectSet::flushDeletedGLBufferObjects+0x25e [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 554]
> 0000018c`3829dc50 : osg156_osgrd!osg::GLBufferObjectManager::flushDeletedGLObjects+0x7e [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 984]
> *** WARNING: Unable to verify checksum for osg156-osgUtilrd.dll
> 0000018c`2e070d90 : osg156_osgrd!osg::ContextData::flushDeletedGLObjects+0x65 [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\contextdata.cpp @ 88]
> *** WARNING: Unable to verify checksum for osg156-osgViewerrd.dll
> 0000018c`37fcbb60 : osg156_osgUtilrd!osgUtil::SceneView::draw+0xdb [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgutil\sceneview.cpp @ 987]
> 0000018d`01da2350 : osg156_osgViewerrd!osgViewer::Renderer::cull_draw+0x309 [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\renderer.cpp @ 887]
> 00000000`00000000 : osg156_osgrd!osg::GraphicsContext::runOperations+0x99 [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\graphicscontext.cpp @ 696]
> 00000000`000003f9 : osg156_osgViewerrd!osgViewer::ViewerBase::renderingTraversals+0xc2d [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\viewerbase.cpp @ 8
> 00000000`000003f9 :
> osg156_osgViewerrd!osgViewer::ViewerBase::frame
>
> attached windbg callstack.
>
>
> any suggestion? fully appreciate!!!
> ...
>
> Thank you!
>
> Cheers,
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74388#74388
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list