g++ 2.95.2 trouble with throw

Nathan Sidwell nathan@codesourcery.com
Thu Jun 29 07:16:00 GMT 2000


fouques wrote:
> 
> Hi Nathan,
> thanks for the information, but i have build the last snapshot on a
>  sun-solaris-2.7 and the test execution result was a core dump instead of abort

> Program received signal SIGABRT, Aborted.
> 0xff316870 in _kill ()
> (gdb) bt
> #0  0xff316870 in _kill ()
> #1  0xff2b92e0 in abort ()
> #2  0x29fbc in __default_unexpected () at ../../gcc/gcc/cp/exception.cc:47
> #3  0x29fc8 in set_terminate (func=0x114) at ../../gcc/gcc/cp/exception.cc:53
> #4  0x2a048 in __cp_exception_info () at ../../gcc/gcc/cp/exception.cc:80
> #5  0x2a368 in __check_eh_spec (n=1, spec=0xffbeec0c)
>     at ../../gcc/gcc/cp/exception.cc:339
> #6  0x2a7fc in __builtin_new (sz=1048576) at ../../gcc/gcc/cp/new1.cc:84
> #7  0x29eb8 in __builtin_vec_new (sz=1048576) at ../../gcc/gcc/cp/new2.cc:41
> #8  0x1c264 in main ()


void my_new_handler ( ) 
    {
    cout << "my_new_handler here!" << endl;
    throw 1;
    }

Your new handler throws an exception which is not derived from bad_alloc
thus violating 18.4.2.2/2. what you are seeing is expected behaviour
(exit via the default unexpected handler)

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


More information about the Gcc-bugs mailing list