[Top][All Lists]

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

gcc3.2.3 : exception caught, but still segment fault

From: lin q
Subject: gcc3.2.3 : exception caught, but still segment fault
Date: Wed, 18 May 2005 20:27:52 -0600

OK, I have some update on this.

I find that I must use "catch (...)" to catch the exception, otherwise there always is a segment fault.

I tried throw an integer and catch an integer, throw a string and catch a string and that throw a self-defined class object and catch that class, these all do not work.

I tried tracing the flow in gdb, but it can only go to the catch statement and then I see something about SIGNAL and flow lost.

But once I use "catch (..)" then whatever type is thrown, it is fine.

It is strange. Any body see it?

I am using gcc3.2.3 as the compiler for my c++ code on Red Hat Linux Enterprise 3. I find that even an exception is caught, "Segment Fault" is still thrown out and program crashes.

 Here is my code,
int func0(){
  if (...some condition...){
    throw MyException();

char* func(){
  catch (MyException& ){
     cout << "Hey catch exception" << endl;
     return NULL;

In running the code, I can see that "Hey catch exception", and then "Segment Fault", it never returns to the caller of func().

 Is this a known problem?

 I wonder

Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

reply via email to

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