I have an application that takes a snapshot of the scene using 
setPostDrawCallback(capture), which gets the image and writes it to a file but 
on completion setting setPostDrawCallback(NULL) crashes on the next expose.

#4  0x00007f681bf08520 in <signal handler called> () at 

#5  0x00007f681db87260 in osgUtil::RenderStage::draw(osg::RenderInfo&, 
osgUtil::RenderLeaf*&) () at /usr/local/lib/libosgUtil.so.161

#6  0x00007f681db92f2c in osgUtil::SceneView::draw() () at 

#7  0x00007f681d69b6b6 in osgViewer::Renderer::cull_draw() () at 

#8  0x00007f681edaa479 in osg::GraphicsContext::runOperations() () at 

#9  0x00007f681d6d5bfd in osgViewer::ViewerBase::renderingTraversals() () at 

#10 0x00007f6835a03b37 in OSGGTKDrawingArea::_expose_event(_GtkGLArea*, 
_GdkGLContext*) (this=0x5575767c6450, area=0x557576c4c2e0, 
context=0x557576c50580) at osggtkdrawingarea.cpp:83

Even if I do nothing in the capture callback it still crashes.

I've looked through the OSG examples but nothing sets the postdraw or finaldraw 
callbacks to NULL, both produce the same crash.

This code has remained unchanged for 10 years but wasn't being used so the 
crash only came to light recently.

I'm using OSG I built from source but I also tried it with 
libopenscenegraph161/jammy on Ubuntu and it still crashes - but strangely 
doesn't render an image but that's a problem for another day.

ldd ./qd3d/nyb/.libs/nyb-2108.1.1 | grep osg

        libosg.so.161 => /usr/local/lib/libosg.so.161 (0x00007faab9200000)

        libosgDB.so.161 => /usr/local/lib/libosgDB.so.161 (0x00007faab8e00000)

        libosgGA.so.161 => /usr/local/lib/libosgGA.so.161 (0x00007faab8a00000)

        libosgText.so.161 => /usr/local/lib/libosgText.so.161 

        libosgUtil.so.161 => /usr/local/lib/libosgUtil.so.161 

        libosgViewer.so.161 => /usr/local/lib/libosgViewer.so.161 

Any ideas?


osg-users mailing list

Reply via email to