|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-08-31 11:23:33
Tanguy Fautre <tanguy.fautre_at_[hidden]> writes:
>>And please bring
>> your Boost.Python questions to the C++-sig
>> <http://boost.org/more/mailing_lists.htm#cplussig>.
>
>
> After doing a minimal example reproducing this error, I think I found
> the problem.
>
> According to the C++ Programming Language (3rd ed), Section 14.7: "It is
> implementation-defined whether destructors are invoked when a program is
> terminated because of an uncaught exception.".
Yes.
> That, I did not know. I thought destructor were always called.
>
> GCC 4.x and Visual C++ 2005 are indeed calling std::terminate without
> calling the destructors. Except... Except when debugging with VC++ 2005.
> When debugging, you have the choice to continue after a uncaught
> exception is thrown as if nothing happened. This effectively leads to a
> segfault as described as above.
I think changing the semantics of "throw x" from "unwind the stack and
maybe terminate" to "continue as though nothing has happened" seems
like it could break any program.
> So it's not a problem with my application nor Boost.Python. Just my
> misunderstanding of uncaught exceptions and of Visual C++.
>
> Sorry I bothered you with this false alert.
'S ok.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk