Web lists-archives.org

Re: [Mingw-users] why is terminate() called?




On Wed, Apr 09, 2008 at 02:46:12AM +0000, Greg Chicares wrote:
> On 2008-04-09 02:23Z, Bob Rossi wrote:
> > 
> > I have a C++ program that I create with mingw gcc-4.2-sjlj only. I
> 
> Does the problem occur if you use gcc-3.4.x instead?

I don't know, I couldn't compile with gcc-3.4 as I require wstring.

> > create a bunch of static libraries, and then link a main program. I've
> > found that in one of the .a libraries I throw an exception and 
> > terminate() is being called, even though the Main.cpp file clearly
> > catches all exceptions.
> > 
> > Does anyone know why I would see this behavior? I am using threads, C++
> > and exceptions.
> 
> There are numerous possible causes. For example, maybe a dtor
> throws during unwinding; maybe an exception-specification is
> violated; maybe a static global's ctor throws....

OK. Does this information help, I set a breakpoing at the place 
where I throw the exception. Then I hit continue, I expect to 
be carried up the stack, 1 frame, where there is another exception
handler. However, when I hit 'c', this is what happens.

c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00ac47f0 in __DTOR_LIST__ ()
(gdb) bt
#0  0x00ac47f0 in __DTOR_LIST__ ()
#1  0x00941536 in _Unwind_SjLj_RaiseException (exc=0x5462350)
    at ../../gcc-4.2.1-2-src/gcc/unwind.inc:117
Backtrace stopped: frame did not save the PC
(gdb)

> > What other information can I provide?
> 
> A minimal self-contained testcase would be helpful.

That could take me days to strip down. If I can't solve this problem
otherwise, I'll create a small testcase.

Thanks for the help,
Bob Rossi

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users