This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC 3.3 exception problem


Hi,

I have just download and built GCC 3.3 and C++ exceptions are causing
problems. Whenever I throw and exception my program aborts and dumps core. I
get the same behaviour on both Solaris 2.6 and 2.8.

The following program is an example.

#include <iostream>

int main()
{
    try
    {
        throw 5;
    }
    catch(int i)
    {
        std::cerr << i << std::endl;
    }
    catch(...)
    {
        std::cerr << "unknown" << std::endl;
    }

    return 0;
}

Here is the stack trace

(gdb) bt
#0  0x6fe54c9c in __sigprocmask () from /usr/lib/libthread.so.1
#1  0x6fe4b9d0 in _resetsig () from /usr/lib/libthread.so.1
#2  0x6fe4b18c in _sigon () from /usr/lib/libthread.so.1
#3  0x6fe4dec8 in _thrp_kill () from /usr/lib/libthread.so.1
#4  0x6febb318 in abort () from /usr/lib/libc.so.1
#5  0x12ca0 in uw_init_context_1 (context=0xeffff470, outer_cfa=0xeffff638,
outer_ra=0x1ae30)
    at ../../gcc-3.3/gcc/unwind-dw2.c:1165
#6  0x1302c in _Unwind_RaiseException (exc=0x59980) at
../../gcc-3.3/gcc/unwind.inc:84
#7  0x1ae38 in __cxa_throw (obj=0x59980, tinfo=0x39d0c, dest=0)
    at ../../../../gcc-3.3/libstdc++-v3/libsupc++/eh_throw.cc:75
#8  0x11560 in main () at main.cpp:7
(gdb)

Here is the configuration of gcc.

geh@lightning:~> gcc-3.3 -v
Reading specs from
/export/development/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2.6/3.3/specs
Configured with: ../gcc-3.3/configure --prefix=/export/development/gcc-3.3
--program-suffix=-3.3 --disable-shared --enable-threads
--enable-languages=c,c++ --with-ld=/usr/local/bin/ld --with-gnu-ld
Thread model: posix
gcc version 3.3


Is this a known problem or have I done something obviously wrong? I did some
googling and had a look in the mail list archives however I can't find
anything similar.

Gary.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]