[osg-users] Crashes on exit

Robert Osfield robert.osfield at gmail.com
Thu Jul 17 05:55:06 PDT 2008


Hi Paul,

Moving the global variables into the scope of the main solves the
crash.  I presume this must be am issue with the automatic clean up
being done in a order that causes problems.

I'd strongly recommend against using global variables in the way you
have here.  Since the crash is easily avoided by using good C++
practices I'm not sure this is an issue that needs addressing, if you
wish to then go ahead.

Robert.

On Thu, Jul 17, 2008 at 9:59 AM, Paul Melis <paul at science.uva.nl> wrote:
> Hi Robert,
>
> With latest SVN. See the attached testcase (reduced from the raytracing
> example posted earlier).
>
> With the default threading model I get crashes on exit for e.g. dumptruck,
> cow and cessnafire:
>
> [cessnafire.osg]
> #0  0x004a10b5 in osg::Group::releaseGLObjects (this=0x8c82038,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> 414             (*itr)->releaseGLObjects(state);
> (gdb) bt
> #0  0x004a10b5 in osg::Group::releaseGLObjects (this=0x8c82038,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #1  0x004a10b8 in osg::Group::releaseGLObjects (this=0x8c363a8,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #2  0x004a10b8 in osg::Group::releaseGLObjects (this=0x8c361d8,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #3  0x004a10b8 in osg::Group::releaseGLObjects (this=0x8c1f548,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #4  0x004a10b8 in osg::Group::releaseGLObjects (this=0x8c19ce0,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #5  0x00402b68 in osg::Camera::releaseGLObjects (this=0x8c19ce0,
> state=0x8ce8a80) at /home/paul/c/osg-svn/src/osg/Camera.cpp:304
> #6  0x00499a2e in osg::GraphicsContext::close (this=0x8c89bd8,
> callCloseImplementation=true)
>   at /home/paul/c/osg-svn/src/osg/GraphicsContext.cpp:460
> #7  0x00aeca0a in ~Viewer (this=0x804b280) at
> /home/paul/c/osg-svn/src/osgViewer/Viewer.cpp:209
> #8  0x080497cd in __tcf_1 ()
> #9  0x005fe949 in exit () from /lib/libc.so.6
> #10 0x005e8d87 in __libc_start_main () from /lib/libc.so.6
> #11 0x080493f1 in _start ()
>
> [dumptruck.osg]
> #0  osgDB::DatabasePager::compileGLObjects (this=0x86418a8,
> state=@0x8732ee8, availableTime=@0x1827100)
>   at /home/paul/c/osg-svn/include/osg/ref_ptr:71
> 71              T* get() const { return _ptr; }
> (gdb) bt
> #0  osgDB::DatabasePager::compileGLObjects (this=0x86418a8,
> state=@0x8732ee8, availableTime=@0x1827100)
>   at /home/paul/c/osg-svn/include/osg/ref_ptr:71
> #1  0x00147eb6 in osgViewer::Renderer::flushAndCompile (this=0x8641ec0,
> currentElapsedFrameTime=0.002323, sceneView=0x8642608,
>   databasePager=0x86418a8, compileThread=0x0) at
> /home/paul/c/osg-svn/src/osgViewer/Renderer.cpp:614
> #2  0x0014cdb5 in osgViewer::Renderer::draw (this=0x8641ec0) at
> /home/paul/c/osg-svn/src/osgViewer/Renderer.cpp:423
> #3  0x00147bc9 in osgViewer::Renderer::operator() (this=0x93bea8,
> context=0x865d0d8) at /home/paul/c/osg-svn/src/osgViewer/Renderer.cpp:635
> #4  0x003c9d4e in osg::GraphicsContext::runOperations (this=0x865d0d8) at
> /home/paul/c/osg-svn/src/osg/GraphicsContext.cpp:688
> #5  0x003cd56f in osg::RunOperations::operator() (this=0x8733650,
> context=0x865d0d8) at /home/paul/c/osg-svn/src/osg/GraphicsThread.cpp:134
> #6  0x003cd40e in osg::GraphicsOperation::operator() (this=0x8733650,
> object=0x865d0d8)
>   at /home/paul/c/osg-svn/src/osg/GraphicsThread.cpp:50
> #7  0x004028fa in osg::OperationThread::run (this=0x87333e0) at
> /home/paul/c/osg-svn/src/osg/OperationThread.cpp:413
> #8  0x003cd63e in osg::GraphicsThread::run (this=0x87333e0) at
> /home/paul/c/osg-svn/src/osg/GraphicsThread.cpp:38
> #9  0x00277b0f in OpenThreads::ThreadPrivateActions::StartThread
> (data=0x87333f0)
>   at /home/paul/c/osg-svn/src/OpenThreads/pthreads/PThread.c++:170
> #10 0x009b3bd4 in start_thread () from /lib/libpthread.so.0
> #11 0x008354fe in clone () from /lib/libc.so.6
>
> With OSG_THREADING set to SingleThreaded it crashes on exit when viewing
> cessnafire.osg (and other models containing particle systems). I don't get
> such crashes on e.g. dumptruck and the cow anymore.
>
> [cessnafire.osg, same as above]
> #0  0x002650b5 in osg::Group::releaseGLObjects (this=0x9fdb040,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> 414             (*itr)->releaseGLObjects(state);
> (gdb) bt
> #0  0x002650b5 in osg::Group::releaseGLObjects (this=0x9fdb040,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #1  0x002650b8 in osg::Group::releaseGLObjects (this=0x9f8f3b0,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #2  0x002650b8 in osg::Group::releaseGLObjects (this=0x9f8f1e0,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #3  0x002650b8 in osg::Group::releaseGLObjects (this=0x9f78550,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #4  0x002650b8 in osg::Group::releaseGLObjects (this=0x9f72ce8,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Group.cpp:414
> #5  0x001c6b68 in osg::Camera::releaseGLObjects (this=0x9f72ce8,
> state=0xa041a88) at /home/paul/c/osg-svn/src/osg/Camera.cpp:304
> #6  0x0025da2e in osg::GraphicsContext::close (this=0x9fe2be0,
> callCloseImplementation=true)
>   at /home/paul/c/osg-svn/src/osg/GraphicsContext.cpp:460
> #7  0x00f1da0a in ~Viewer (this=0x804b280) at
> /home/paul/c/osg-svn/src/osgViewer/Viewer.cpp:209
> #8  0x080497cd in __tcf_1 ()
> #9  0x00795949 in exit () from /lib/libc.so.6
> #10 0x0077fd87 in __libc_start_main () from /lib/libc.so.6
> #11 0x080493f1 in _start ()
>
>
> Paul
>
> _______________________________________________
> 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