Am 19.01.2015 21:27, schrieb Robert Osfield:
Hi Sebastian,

I haven't had chance to try and reproduce the bug yet. The description sounds like there an initialization order issue with the osg::State. In theory the osg::State object now does the initalization, and the osg::GraphicsContext on the first makeCurrent() should ensure that it's set up correctly, in theory this should be the first set of OpenGL calls made.

What is application you are testing within? What is the platform?
Windows 7, VisualStudio 2010.
It is crashing in a minimal application as well as using osgviewer.
Have you tried to use my minimal database? It reproduces the crash when loading it with the osgviewer and stiring around with the mouse a bit. (Also take a look at the attached picture: It shows a messed up State) I was able to fix the crash by removing the GLExentsions::Set(contextId,0) in the State destructor. But this seems plain wrong. I suspect on my platform, the State is cleared and reinitialized for some reason. When I can spent some time on this, I can try to create a minimal example. Just out of curiosity: Is there any reason for the State to remove the extensions for the ContextID? I suspect there is only one State per Context, which seems ok, but I cannot grasp, why it is released in my scenario.

Also I had problems after the fix loading other databases; It seems the range lists in paging are invalid. It randomly displays the wrong tiles with wrong facing. I'll try to hunt this down too.
Any suggestions how to narrow down the problem on my side?

Cheers
Sebastian


Robert.

On 19 January 2015 at 10:07, Sebastian Messerschmidt <sebastian.messerschm...@gmx.de <mailto:sebastian.messerschm...@gmx.de>> wrote:

    Hi Robert,

    as already written, the problem is an invalidated _extensions object.
    It seems to be invalidated by the State destructor, which causes
    the destructor of the GLExtensions object to be called. (I've got
    there using a memory breakpoint)
    I've attached a callstack for analysis. (i've added a destructor
    for the GLExtensions for testing)

    Cheers
    Sebastian


    <snip>
         osg116-osgd.dll!osg::Referenced::~Referenced() Line 234    C++
         osg116-osgd.dll!osg::GLExtensions::~GLExtensions() + 0x28
    bytes    C++
         osg116-osgd.dll!osg::GLExtensions::`vector deleting
    destructor'()  + 0x7d bytes    C++
    osg116-osgd.dll!osg::Referenced::signalObserversAndDelete(bool
    signalDelete, bool doDelete)  Line 324 + 0x31 bytes C++
         osg116-osgd.dll!osg::Referenced::unref()  Line 200    C++
    osg116-osgd.dll!osg::ref_ptr<osg::GLExtensions>::operator=(osg::GLExtensions
    * ptr)  Line 59    C++
         osg116-osgd.dll!osg::GLExtensions::Set(unsigned int
    contextID, osg::GLExtensions * extensions)  Line 429 C++
    >    osg116-osgd.dll!osg::State::~State()  Line 136    C++
         osg116-osgUtild.dll!osg::State::`scalar deleting
    destructor'()  + 0x2d bytes    C++
    osg116-osgd.dll!osg::Referenced::signalObserversAndDelete(bool
    signalDelete, bool doDelete)  Line 324 + 0x31 bytes C++
         osg116-osgd.dll!osg::Referenced::unref()  Line 200    C++
    osg116-osgUtild.dll!osg::ref_ptr<osg::State>::operator=(osg::State
    * ptr)  Line 59    C++
osg116-osgUtild.dll!osg::RenderInfo::setState(osg::State * state) Line 57 + 0x32 bytes C++
    osg116-osgUtild.dll!osgUtil::SceneView::setState(osg::State *
    state)  Line 184 + 0x3b bytes    C++
    
osg116-osgViewerd.dll!osgViewer::Renderer::updateSceneView(osgUtil::SceneView
    * sceneView)  Line 517    C++
         osg116-osgViewerd.dll!osgViewer::Renderer::cull() Line 625    C++
    osg116-osgViewerd.dll!osgViewer::ViewerBase::renderingTraversals()
    Line 826    C++
    osg116-osgViewerd.dll!osgViewer::ViewerBase::frame(double
    simulationTime)  Line 677    C++
         osg116-osgViewerd.dll!osgViewer::ViewerBase::run() Line
    647    C++
         osg116-osgViewerd.dll!osgViewer::Viewer::run() Line 420    C++
         RenderTest_d.exe!main(int argc, char * * argv) Line 66 + 0xb
    bytes    C++
         RenderTest_d.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes    C
         RenderTest_d.exe!mainCRTStartup()  Line 371    C
    </snip>

    Hi Robert,

    would you expect problems with old osgTerrain databases (build
    with ~3.2.0, osgb format)?
    I have some strange behaviour with a huge database, which simply
    not displayed anymore and somehow breaks state (See attached
    picture).
    Also there is a warning coming from an optimzer I guess:

    Warning: CollectLowestTransformsVisitor::removeTransforms()
    error, encountered a NULL Transform pointer

    A second, much smaller database is sometimes displayed, but
    crashes the viewer sometimes.
    Unfortunately my first email, containing a database didn't get
    through.

    It is really hard to find the culprit.

    Any hints?

    I'll investigate the issue further ...

    Cheers
    Sebastian


    _______________________________________________
    osg-users mailing list
    osg-users@lists.openscenegraph.org
    <mailto: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

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to