This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Throwing exception in constructor causes segfault
- From: Craig Rodrigues <rodrigc at attbi dot com>
- To: gcc at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 23 Feb 2002 16:58:46 -0500
- Subject: Re: Throwing exception in constructor causes segfault
- References: <20020223150023.A3639@attbi.com> <jeadtzyl0v.fsf@sykes.suse.de>
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