Does the code crash whether you enable or disable the debug output?

On Tue, 31 Mar 2020 at 08:15, OpenSceneGraph Users <
osg-users@lists.openscenegraph.org> wrote:

> Hello everyone,
>
> recently I encountered a sporadic crash in my App at same position upon
> calling function Renderer::draw() in osgViewer/Renderer.cpp. The crash
> happend at
>
> *  DEBUG_MESSAGE<<"draw() got SceneView "<<sceneView<<std::endl; *(screenshots
> of callstack are attached)
>
> and triggerd an exception via a string of basic streambuf operations very
> deep down to msvcp100d.dll in dbgheap.c
>
>         * /**
> *         * If this ASSERT fails, a bad pointer has been passed in. It may
> be*
> *         * totally bogus, or it may have been allocated from another
> heap.*
> *         * The pointer MUST come from the 'local' heap.*
> *         */*
> *        _ASSERTE(_CrtIsValidHeapPointer(pUserData)); * ----> assertion
> error thrown, the heap pointer is invalid
>
> In debug session I checked the call stack step by step and found that when
> putting "*draw() got SceneView*" in stringbuffer, functoin overflow of
> std::basic_stringbuf is triggerd, and subsequently
> the deallocate step at :
>                         *if (_Mystate & _Allocated)*
> * _Al.deallocate(_Oldptr, _Oldsize);*
> * _Mystate |= _Allocated;*
> was executed. it tried to deallocate the buffer, pointed by "_Oldptr" with
> size "_Oldsize". But the size is smaller than the actual buffer length.
> Therefore the assertion error above was thrown.
>
> Info to my App:
> I enhance the viewer with osgWidget::WindowManager. My App recieves
> external data cyclic and renders boxes and lines in one data transmission
> framework. The API of this framework calls my viewer to render every 20ms,
> an example of this call:
>    framework::call_on_cycle () {  // main thread
>                    // process and storing incoming data
>                    process_data();
>                    myViewer->frame();
>  }
>
> My App runs at DrawThreadPerContext mode and updates drawables in callback
> and setting them as DYNAMIC.
>
> Is there anyone ever facing similar Problem? Or any ideas to analyse or
> sort this out? I will really appreciate any help.
>
> Thank you
>
> Regards,
> Yuan
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/b0bac75e-6cdb-47f7-9ede-1e8aa931af4c%40googlegroups.com
> <https://groups.google.com/d/msgid/osg-users/b0bac75e-6cdb-47f7-9ede-1e8aa931af4c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> _______________________________________________
> 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