bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't catch any throw()s


From: Roy Riggs
Subject: Can't catch any throw()s
Date: 24 Jul 2002 15:59:39 -0700

Whenever I call throw(), no matter what I do, it acts like there's not
a matching catch(), even if I used catch(...) its always calling
std::terminate()

My application, my test application, and this test application all
work fine on other boxes with other compilers. Here's a sample app I
found on the net which exhibits the same crash as our apps.


Intel Linux box, G++ V3.1

Compiled with:  g++ -g -fexceptions -o test  test.cpp


#include <iostream>
#include <exception>
#include <typeinfo>

class A {virtual void f() {}; };

int main () {
  try {
    A * a = NULL;
    typeid (*a);
  }
  catch (std::exception& e)
    {
      std::cout << "Exception: " << e.what();
    }
  return 0;
}


gdb says:

This GDB was configured as "i686-pc-linux-gnu"...
((gdb) run
Starting program: /home/rriggs/work/cips32.mtx/source/frameeng/test

Program received signal SIGABRT, Aborted.
0x4012eae1 in __kill () at __kill:-1
-1      __kill: No such file or directory.
        in __kill
Current language:  auto; currently c
(gdb) where
#0  0x4012eae1 in __kill () at __kill:-1
#1  0x4012e8ba in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40130062 in abort () at ../sysdeps/generic/abort.c:88
#3  0x400b5077 in __cxxabiv1::__terminate(void (*)())
(handler=0x4012ff04 <abort>)
    at ../../../../gcc-3.1/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x400b50c4 in std::terminate() () at
../../../../gcc-3.1/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x400b5266 in __cxa_throw () at
../../../../gcc-3.1/libstdc++-v3/libsupc++/eh_throw.cc:77
#6  0x400b410d in __cxa_bad_typeid () at
../../../../gcc-3.1/libstdc++-v3/libsupc++/eh_aux_runtime.cc:52
#7  0x08048755 in main () at test.cpp:35
#8  0x4011c627 in __libc_start_main (main=0x8048730 <main>, argc=1,
ubp_av=0xbffff974, init=0x80485ac <_init>,
    fini=0x8048880 <_fini>, rtld_fini=0x4000dcc4 <_dl_fini>,
stack_end=0xbffff96c) at ../sysdeps/generic/libc-start.c:129



reply via email to

[Prev in Thread] Current Thread [Next in Thread]