public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Can't catch any throw on gcc 3.0.4
@ 2005-02-02 13:52 Tan-Long Phan
  0 siblings, 0 replies; 5+ messages in thread
From: Tan-Long Phan @ 2005-02-02 13:52 UTC (permalink / raw)
  To: 'lrtaylor@micron.com'; +Cc: gcc-help

Hi Lyle

Yes, I'm linking my stuff with g++ and the exceptions are thrown across
library boundaries. My main application was linked with different dynamic
libraries and static libraries, the try and catch are done in the static
library and the exceptions are thrown from the dynamic library.

Thanks & Regards

Long 

-----Original Message-----
From: lrtaylor@micron.com [mailto:lrtaylor@micron.com]
Sent: Tuesday, February 01, 2005 5:55 PM
To: longp@cae.com; gcc-help@gcc.gnu.org
Subject: RE: Can't catch any throw on gcc 3.0.4


Are you linking your application using g++ or gcc?  You should be using
g++.  Also, are you throwing the exception across library boundaries, or
is it all in the same executable or library?

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Tan-Long Phan
Sent: Tuesday, February 01, 2005 1:30 PM
To: gcc-help@gcc.gnu.org
Subject: Can't catch any throw on gcc 3.0.4

Hi 

I'm writing an application on Linux 7.3 using gcc 3.0.4 and having a
little
problem with the exception handling. It works fine with MSVC. The stack
was:

Program received signal SIGABRT, Aborted.
0x42029331 in kill () from /lib/i686/libc.so.6
(gdb) where
#0  0x42029331 in kill () from /lib/i686/libc.so.6
#1  0x4202911a in raise () from /lib/i686/libc.so.6
#2  0x4202a8c2 in abort () from /lib/i686/libc.so.6
#3  0x400a0a35 in __cxxabiv1::__terminate(void (*)())
(handler=0x4202a754
<abort>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x400a0a70 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a70
<__cxxabiv1::__unexpected(void (*)())>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x400a0a85 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a50
<std::terminate()>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:63
#6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at
../../../../libstdc++-v3/libsupc++/eh_personality.cc:417
#7  0x40c28aaa in
com_cae::rti::FM::SlaveFederationManager::throwResponseError()
(this=0x8188548) at
/data/rti/cae/caeRti-1.0.23/mrti/dev/src/FM/CaeRti_SlaveFederationManage
r.cx
x:68


Do you have any idea?

Thanks & Regards

Long

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Can't catch any throw on gcc 3.0.4
@ 2005-02-02 14:22 Martin York
  0 siblings, 0 replies; 5+ messages in thread
From: Martin York @ 2005-02-02 14:22 UTC (permalink / raw)
  To: Tan-Long Phan, gcc-help



Are you using exception-specifications on your methods?

The call to 
> #6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at

Suggests that you are throwing an exception that is not listed in a
callers list of valid (expected) exceptions.

eg.

#include <iostream>

struct X
{
   void test() throw (int)   // If anything but an int is thrown it will
not be caught.
   {
        throw char('a');
   }
};

int main(int argc,char *argv[])
{
    try
    {
        X  x;
        x.test();
    }
    catch(char& x)
    {
        std::cout << "Caught Char: (" << x <<")\n";
    }
    catch(int& x)
    {
        std::cout << "Caught Int: (" << x <<"(\n";
    }
    catch(...)
    {
        std::cout << "Something\n";
    }
    return(0);
}



-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Tan-Long Phan
Sent: 01 February 2005 15:30
To: gcc-help@gcc.gnu.org
Subject: Can't catch any throw on gcc 3.0.4

Hi 

I'm writing an application on Linux 7.3 using gcc 3.0.4 and having a
little problem with the exception handling. It works fine with MSVC. The
stack was:

Program received signal SIGABRT, Aborted.
0x42029331 in kill () from /lib/i686/libc.so.6
(gdb) where
#0  0x42029331 in kill () from /lib/i686/libc.so.6
#1  0x4202911a in raise () from /lib/i686/libc.so.6
#2  0x4202a8c2 in abort () from /lib/i686/libc.so.6
#3  0x400a0a35 in __cxxabiv1::__terminate(void (*)())
(handler=0x4202a754
<abort>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x400a0a70 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a70 <__cxxabiv1::__unexpected(void (*)())>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x400a0a85 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a50
<std::terminate()>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:63
#6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at
../../../../libstdc++-v3/libsupc++/eh_personality.cc:417
#7  0x40c28aaa in
com_cae::rti::FM::SlaveFederationManager::throwResponseError()
(this=0x8188548) at
/data/rti/cae/caeRti-1.0.23/mrti/dev/src/FM/CaeRti_SlaveFederationManage
r.cx
x:68


Do you have any idea?

Thanks & Regards

Long

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Can't catch any throw on gcc 3.0.4
@ 2005-02-01 22:54 lrtaylor
  0 siblings, 0 replies; 5+ messages in thread
From: lrtaylor @ 2005-02-01 22:54 UTC (permalink / raw)
  To: longp, gcc-help

Are you linking your application using g++ or gcc?  You should be using
g++.  Also, are you throwing the exception across library boundaries, or
is it all in the same executable or library?

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Tan-Long Phan
Sent: Tuesday, February 01, 2005 1:30 PM
To: gcc-help@gcc.gnu.org
Subject: Can't catch any throw on gcc 3.0.4

Hi 

I'm writing an application on Linux 7.3 using gcc 3.0.4 and having a
little
problem with the exception handling. It works fine with MSVC. The stack
was:

Program received signal SIGABRT, Aborted.
0x42029331 in kill () from /lib/i686/libc.so.6
(gdb) where
#0  0x42029331 in kill () from /lib/i686/libc.so.6
#1  0x4202911a in raise () from /lib/i686/libc.so.6
#2  0x4202a8c2 in abort () from /lib/i686/libc.so.6
#3  0x400a0a35 in __cxxabiv1::__terminate(void (*)())
(handler=0x4202a754
<abort>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x400a0a70 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a70
<__cxxabiv1::__unexpected(void (*)())>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x400a0a85 in __cxxabiv1::__unexpected(void (*)())
(handler=0x400a0a50
<std::terminate()>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:63
#6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at
../../../../libstdc++-v3/libsupc++/eh_personality.cc:417
#7  0x40c28aaa in
com_cae::rti::FM::SlaveFederationManager::throwResponseError()
(this=0x8188548) at
/data/rti/cae/caeRti-1.0.23/mrti/dev/src/FM/CaeRti_SlaveFederationManage
r.cx
x:68


Do you have any idea?

Thanks & Regards

Long


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Can't catch any throw on gcc 3.0.4
  2005-02-01 20:31 Tan-Long Phan
@ 2005-02-01 20:39 ` Joe Hughes
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Hughes @ 2005-02-01 20:39 UTC (permalink / raw)
  To: Tan-Long Phan; +Cc: gcc-help

try -fexceptions when compiling your application.


Tan-Long Phan wrote on 2/1/2005, 3:29 PM:

 > Hi
 >
 > I'm writing an application on Linux 7.3 using gcc 3.0.4 and having a
 > little
 > problem with the exception handling. It works fine with MSVC. The
 > stack was:
 >
 > Program received signal SIGABRT, Aborted.
 > 0x42029331 in kill () from /lib/i686/libc.so.6
 > (gdb) where
 > #0  0x42029331 in kill () from /lib/i686/libc.so.6
 > #1  0x4202911a in raise () from /lib/i686/libc.so.6
 > #2  0x4202a8c2 in abort () from /lib/i686/libc.so.6
 > #3  0x400a0a35 in __cxxabiv1::__terminate(void (*)()) (handler=0x4202a754
 > <abort>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
 > #4  0x400a0a70 in __cxxabiv1::__unexpected(void (*)())
 > (handler=0x400a0a70
 > <__cxxabiv1::__unexpected(void (*)())>) at
 > ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
 > #5  0x400a0a85 in __cxxabiv1::__unexpected(void (*)())
 > (handler=0x400a0a50
 > <std::terminate()>) at
 > ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:63
 > #6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at
 > ../../../../libstdc++-v3/libsupc++/eh_personality.cc:417
 > #7  0x40c28aaa in
 > com_cae::rti::FM::SlaveFederationManager::throwResponseError()
 > (this=0x8188548) at
 > 
/data/rti/cae/caeRti-1.0.23/mrti/dev/src/FM/CaeRti_SlaveFederationManager.cx 

 >
 > x:68
 >
 >
 > Do you have any idea?
 >
 > Thanks & Regards
 >
 > Long
 >


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Can't catch any throw on gcc 3.0.4
@ 2005-02-01 20:31 Tan-Long Phan
  2005-02-01 20:39 ` Joe Hughes
  0 siblings, 1 reply; 5+ messages in thread
From: Tan-Long Phan @ 2005-02-01 20:31 UTC (permalink / raw)
  To: gcc-help

Hi 

I'm writing an application on Linux 7.3 using gcc 3.0.4 and having a little
problem with the exception handling. It works fine with MSVC. The stack was:

Program received signal SIGABRT, Aborted.
0x42029331 in kill () from /lib/i686/libc.so.6
(gdb) where
#0  0x42029331 in kill () from /lib/i686/libc.so.6
#1  0x4202911a in raise () from /lib/i686/libc.so.6
#2  0x4202a8c2 in abort () from /lib/i686/libc.so.6
#3  0x400a0a35 in __cxxabiv1::__terminate(void (*)()) (handler=0x4202a754
<abort>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x400a0a70 in __cxxabiv1::__unexpected(void (*)()) (handler=0x400a0a70
<__cxxabiv1::__unexpected(void (*)())>) at
../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x400a0a85 in __cxxabiv1::__unexpected(void (*)()) (handler=0x400a0a50
<std::terminate()>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:63
#6  0x400a092a in __cxa_call_unexpected (exc_obj=0x81b9730) at
../../../../libstdc++-v3/libsupc++/eh_personality.cc:417
#7  0x40c28aaa in
com_cae::rti::FM::SlaveFederationManager::throwResponseError()
(this=0x8188548) at
/data/rti/cae/caeRti-1.0.23/mrti/dev/src/FM/CaeRti_SlaveFederationManager.cx
x:68


Do you have any idea?

Thanks & Regards

Long

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-02 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-02 13:52 Can't catch any throw on gcc 3.0.4 Tan-Long Phan
  -- strict thread matches above, loose matches on Subject: below --
2005-02-02 14:22 Martin York
2005-02-01 22:54 lrtaylor
2005-02-01 20:31 Tan-Long Phan
2005-02-01 20:39 ` Joe Hughes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).