Hi Alexander,

Are you dynamically modifying the text?  If so then just set the
DataVariance of the Text objects to DYNAMIC.

Explanation : When running in DrawThreadPerContext, and
CullThreadPerCameraDrawThreadPerContext the update,cull of the next
frame is allowed to overlap with rendering of the previous frame.
This also means that their is potential for the update phase to be
modifying the scene graph at the same time that its being read - which
causes crashes.  The mechinism for prevent these read/write collisions
is to set the dynamically modified Drawables and
StateSet/StateAttribute to have a DataVariance of DYNAMIC, and then
the rendering traversal then holds back the next frame till all
DYNAMIC objects have been drawn.

This topic has been written about lots of time on osg-users over the
past year, and also mentioned in the Quick Start Guide.

Robert.

On Fri, Aug 22, 2008 at 10:36 AM, Alexander Löffler
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am experiencing very frequent segfaults in OSG'S rendering thread when
> working with osgText::Text objects. The problem always appears in
> State::applyTextureAttributes(), but at different positions in there. Most
> of the time in StateAttribute::getTypeMemberPair(), though, an exemplary
> backtrace for this is attached.
>
> The crash happens when changing text attributes, like color and size, but
> also when manipulating higher-level objects in the scene graph (setting
> NodeMasks of subgraphs containing the Text, etc.).
>
> Has anyone experienced similar behavior before? It always seems to be
> connected to updates of textures, especially when having overlapping
> textures like Text on top of an image texture.
>
> Could this also be somehow related to third party libraries like Freetype?
>
> Thanks a lot for your help,
> Alex.
>
> BTW, I am working with OSG 2.6.0 under Linux (SUSE, GCC 4.2.1) and an nVidia
> GeForce 8400.
>
> --
>
> #0  0xb6dba374 in osg::StateAttribute::getTypeMemberPair (this=0x862b7f0)
>    at /home/al/src/OpenSceneGraph-2.6.0/include/osg/StateAttribute:228
> #1  0xb6dc2945 in osg::State::applyTextureAttribute (this=0x8212840, unit=0,
> attribute=0x862b7f0)
>    at /home/al/src/OpenSceneGraph-2.6.0/include/osg/State:335
> #2  0xb60ec704 in osgText::Text::renderOnlyForegroundText (this=0xac1213e0,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgText/Text.cpp:1750
> #3  0xb60efc1a in osgText::Text::drawImplementation (this=0xac1213e0,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgText/Text.cpp:1365
> #4  0xb60f01ee in osgText::Text::drawImplementation (this=0xac1213e0,
> [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgText/Text.cpp:1252
> #5  0xb63cb5cb in osg::Drawable::draw (this=0xac1213e0,
> [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/include/osg/Drawable:895
> #6  0xb63ca508 in osgUtil::RenderLeaf::render (this=0x83114f0,
> [EMAIL PROTECTED], previous=0x8315610)
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderLeaf.cpp:60
> #7  0xb63bed52 in osgUtil::RenderBin::drawImplementation (this=0x8969248,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderBin.cpp:419
> #8  0xb63be5cd in osgUtil::RenderBin::draw (this=0x8969248,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderBin.cpp:384
> #9  0xb63befe4 in osgUtil::RenderBin::drawImplementation (this=0x8215bb8,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderBin.cpp:469
> #10 0xb63cc062 in osgUtil::RenderStage::drawImplementation (this=0x8215bb8,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderStage.cpp:1233
> #11 0xb63be5cd in osgUtil::RenderBin::draw (this=0x8215bb8,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderBin.cpp:384
> #12 0xb63ccb48 in osgUtil::RenderStage::drawInner (this=0x8215bb8,
> [EMAIL PROTECTED], [EMAIL PROTECTED],
>    [EMAIL PROTECTED]) at
> /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderStage.cpp:829
> #13 0xb63cf995 in osgUtil::RenderStage::draw (this=0x8215bb8,
> [EMAIL PROTECTED], [EMAIL PROTECTED])
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/RenderStage.cpp:1090
> #14 0xb63dda57 in osgUtil::SceneView::draw (this=0x8214d60) at
> /home/al/src/OpenSceneGraph-2.6.0/src/osgUtil/SceneView.cpp:1509
> #15 0xb6a9f756 in osgViewer::Renderer::draw (this=0x8214b60) at
> /home/al/src/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:413
> #16 0xb6a9b2db in osgViewer::Renderer::operator() (this=0x8214b60,
> context=0x80bbe58)
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osgViewer/Renderer.cpp:640
> #17 0xb6e0d96c in osg::GraphicsContext::runOperations (this=0x80bbe58)
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osg/GraphicsContext.cpp:688
> #18 0xb6e18fd5 in osg::RunOperations::operator() (this=0x82171d8,
> context=0x80bbe58)
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:134
> #19 0xb6e196bc in osg::GraphicsOperation::operator() (this=0x82171d8,
> object=0x80bbe58)
>    at /home/al/src/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:50
> #20 0xb6e5dab4 in osg::OperationThread::run (this=0x8216f58) at
> /home/al/src/OpenSceneGraph-2.6.0/src/osg/OperationThread.cpp:413
> #21 0xb6e1975b in osg::GraphicsThread::run (this=0x8216f58) at
> /home/al/src/OpenSceneGraph-2.6.0/src/osg/GraphicsThread.cpp:38
> #22 0xb67b29de in OpenThreads::ThreadPrivateActions::StartThread
> (data=0x8216f68)
>    at
> /home/al/src/OpenSceneGraph-2.6.0/src/OpenThreads/pthreads/PThread.c++:170
> #23 0xb7d42192 in start_thread () from /lib/libpthread.so.0
> #24 0xb687b02e in clone () from /lib/libc.so.6
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to