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

Alberto Luaces aluaces at udc.es
Mon Mar 6 01:27:23 PST 2023


I would first begin by using inspection tools as valgrind or the
gcc/clang sanitizers, because this looks like a thread synchronization
problem.

"Broi, Franco" writes:

> Hi,
>
> 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?
>
> Cheers,
>

-- 
Alberto



More information about the osg-users mailing list