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

2023-03-06 Thread Alberto Luaces
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  0x7f681bf08520 in  () at 
> /lib/x86_64-linux-gnu/libc.so.6
> #5  0x7f681db87260 in osgUtil::RenderStage::draw(osg::RenderInfo&, 
> osgUtil::RenderLeaf*&) () at /usr/local/lib/libosgUtil.so.161
> #6  0x7f681db92f2c in osgUtil::SceneView::draw() () at 
> /usr/local/lib/libosgUtil.so.161
> #7  0x7f681d69b6b6 in osgViewer::Renderer::cull_draw() () at 
> /usr/local/lib/libosgViewer.so.161
> #8  0x7f681edaa479 in osg::GraphicsContext::runOperations() () at 
> /usr/local/lib/libosg.so.161
> #9  0x7f681d6d5bfd in osgViewer::ViewerBase::renderingTraversals() () at 
> /usr/local/lib/libosgViewer.so.161
> #10 0x7f6835a03b37 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 (0x7faab920)
>   libosgDB.so.161 => /usr/local/lib/libosgDB.so.161 (0x7faab8e0)
>   libosgGA.so.161 => /usr/local/lib/libosgGA.so.161 (0x7faab8a0)
>   libosgText.so.161 => /usr/local/lib/libosgText.so.161 
> (0x7faab860)
>   libosgUtil.so.161 => /usr/local/lib/libosgUtil.so.161 
> (0x7faab800)
>   libosgViewer.so.161 => /usr/local/lib/libosgViewer.so.161 
> (0x7faab7c0)
>
> Any ideas?
>
> Cheers,
>

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2023-03-05 Thread Broi, Franco
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  0x7f681bf08520 in  () at 
/lib/x86_64-linux-gnu/libc.so.6

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

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

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

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

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

#10 0x7f6835a03b37 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 (0x7faab920)

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

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

libosgText.so.161 => /usr/local/lib/libosgText.so.161 
(0x7faab860)

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

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

Any ideas?

Cheers,

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org