[osg-users] Signal 11 after calling setPostDrawCallback(NULL)

Broi, Franco f.broi at fugro.com
Sun Mar 5 21:58:22 PST 2023


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 /lib/x86_64-linux-gnu/libc.so.6

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

#6  0x00007f681db92f2c in osgUtil::SceneView::draw() () at /usr/local/lib/libosgUtil.so.161

#7  0x00007f681d69b6b6 in osgViewer::Renderer::cull_draw() () at /usr/local/lib/libosgViewer.so.161

#8  0x00007f681edaa479 in osg::GraphicsContext::runOperations() () at /usr/local/lib/libosg.so.161

#9  0x00007f681d6d5bfd in osgViewer::ViewerBase::renderingTraversals() () at /usr/local/lib/libosgViewer.so.161

#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 (0x00007faab8600000)

        libosgUtil.so.161 => /usr/local/lib/libosgUtil.so.161 (0x00007faab8000000)

        libosgViewer.so.161 => /usr/local/lib/libosgViewer.so.161 (0x00007faab7c00000)

Any ideas?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20230306/ba24922c/attachment.htm>

More information about the osg-users mailing list