Hi Stephan,

thanks for looking at this.

As an aside, I'm Uli, not Andreas, and - I believe we spent some time together at Art+Com :-).

This is the first call:

#0  0x00688bba in osgViewer::PixelBufferCarbon::closeImplementation ()
#1  0x092a012f in osg::GraphicsContext::close ()
#2  0x0066f910 in osgViewer::Viewer::~Viewer ()
#3 0x08c65eb8 in avg::OSGNode::disconnect (this=0x1ef447d0, bKill=4098347009) at /usr/local/include/osg/Referenced:183

and this the second:

#0  0x00688bba in osgViewer::PixelBufferCarbon::closeImplementation ()
#1 0x092a012f in osg::GraphicsContext::close () at function_template.hpp:1010
#2  0x00688e23 in osgViewer::PixelBufferCarbon::~PixelBufferCarbon ()
#3 0x0920e825 in osg::Referenced::unref () at function_template.hpp: 1010 #4 0x092049c0 in osg::ref_ptr<osg::GraphicsContext>::~ref_ptr () at function_template.hpp:1010
#5  0x09201aff in osg::Camera::~Camera () at function_template.hpp:1010
#6 0x08c65ed8 in avg::OSGNode::disconnect (this=0x1ef447d0, bKill=4098347009) at /usr/local/include/osg/Referenced:183

The setup looks like this: The context is created on a pbuffer, but this pbuffer is never rendered to and doesn't have a camera. All rendering happens in an FBO. The camera in the second stack trace isn't attached to the pbuffer at all - it's rendering to the FBO.

This is OSG 2.8.3.

Applying your patch seems to fix (or at least hide) it, but as I said: The error is hard to reproduce and I'm not sure whether it's really gone.

Cheers,

 Uli

On Apr 30, 2010, at 5:02 PM, Stephan Maximilian Huber wrote:

Hi Andreas,

the underlying problem is the double-free. Can you provide two
stack-traces for the two calls of PixelBufferCarbon::closeImplementation?

as the x11-implementation of closeImplementation does nothing fancy,
there's nothing which can crash ;-)

A quick and dirty fix for PixelBufferCarbon would be:

if (_pbuffer) { aglDestroyPBuffer(_pbuffer); _pbuffer = NULL; }
if (_context) { aglDestroyContext(_context); _context = NULL; }
if (_pixelformat) { aglDestroyPixelFormat(_pixelformat); _pixelformat =
NULL; }

can you provide some more details about how your viewer-setup?

cheers,

Stephan


Am 30.04.10 15:14, schrieb Ulrich von Zadow:
Hi,

my OSG program crashes on end:

Thread 0 Crashed:
0 com.apple.agl 0x91e52a71 aglDestroyPixelFormat + 60
1   libosgViewer.65.dylib             0x00688c16
osgViewer::PixelBufferCarbon::closeImplementation() + 150
2   libosg.65.dylib                   0x092a012f
osg::GraphicsContext::close(bool) + 1019
3   libosgViewer.65.dylib             0x00688e35
osgViewer::PixelBufferCarbon::~PixelBufferCarbon() + 47
4   osgnode.so                        0x08c65f7b
avg::OSGNode::disconnect(bool) + 475 (Referenced:183)

The crash isn't really reproducible, but it happens only on a mac, never
under linux.

What's irritating me (besides the crash itself ;-)) is that
PixelBufferCarbon::closeImplementation() is called twice. Here is the
osg logging output with output added to the closeImplementation call:

Viewer::~Viewer():: start destructor getThreads = 0
close(1)0x1ef4f600
Releasing GL objects for Camera=0xa0d000 _state=0x3ab730
Closing still viable window 0 _state->getContextID()=0
Doing Flush
Done Flush
PixelBufferCarbon::closeImplementation: 0x1ef4f600
 _pixelformat: 0x1ef4f728
Doing discard of deleted OpenGL objects.
decrementUsageCount()0
GraphicsContext::decrementContextIDUsageCount(0) to 0
Viewer::~Viewer() end destrcutor getThreads = 0
Destructing osgViewer::View
Destructing osg::View
close(1)0x1ef4f600
PixelBufferCarbon::closeImplementation: 0x1ef4f600
 _pixelformat: 0x1ef4f728
close(0)0x1ef4f600
GraphicsContext::unregisterGraphicsContext 0x1ef4f600
Done destructing osg::View

The crash happens (when it does) at the second
PixelBufferCarbon::closeImplementation line.

Any idea what I might be doing wrong? The logging output is a response
to dereferencing the Viewer - nothing more.

Cheers,

 Uli


--
Ulrich von Zadow
Software Engineer (Dipl. Inf.)
Exhibit Development

Tel +49 (0)30 / 2000 577 12
Fax +49 (0)30 / 2000 577 20
Skype: uzadow

Archimedes Solutions GmbH
Saarbrücker Str. 24 10405 Berlin

www.archimedes-solutions.com

Geschäftsführung:
W. Rien | J. Schmidtsiefen | S. Spenling

Amtsgericht: Berlin Charlottenburg
HR Nr.: 107563 B
UST-ID Nr.: DE-253.771.793








_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
Ulrich von Zadow
Software Engineer (Dipl. Inf.)
Exhibit Development

Tel +49 (0)30 / 2000 577 12
Fax +49 (0)30 / 2000 577 20
Skype: uzadow

Archimedes Solutions GmbH
Saarbrücker Str. 24 10405 Berlin

www.archimedes-solutions.com

Geschäftsführung:
W. Rien | J. Schmidtsiefen | S. Spenling

Amtsgericht: Berlin Charlottenburg
HR Nr.: 107563 B
UST-ID Nr.: DE-253.771.793








_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to