Throwing exception in constructor causes segfault

Craig Rodrigues rodrigc@attbi.com
Sat Feb 23 14:23:00 GMT 2002


On Sat, Feb 23, 2002 at 09:56:48PM +0100, Andreas Schwab wrote:
> The problem is that operator delete[]() is receiving a different address
> than returned by operator new[]().  It looks like it is not adjusted for
> the cookie.

I don't understand the gcc exception handling code, so
can you explain this in more detail?   What is a cookie
in this case?

Also, in my testcase, if you comment out the delete[] p; line,
the testcase will still segfault.  Looks like delete[] is
called in the stack unwind code for some reason, if you
don't call it yourself.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@attbi.com



More information about the Gcc mailing list