c++/10840: any way to catch a segmentation fault error?

snowboy@orgio.net snowboy@orgio.net
Sun May 18 02:23:00 GMT 2003


>Number:         10840
>Category:       c++
>Synopsis:       any way to catch a segmentation fault error?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 18 01:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     snowboy@orgio.net
>Release:        unknown-1.0
>Organization:
>Environment:
g++ 3.0.4 on Sun Unix
>Description:
Hi.

I am using g++ 3.0.4 on Sun Unix server.
I just wanted to check whether (...) works or not.
This code works after being compiled by  VC++ , but g++ doesn't.
Is this bug?
Is there any way that I can catch the segmentation fault error using standard C++ try/catch expression?


try {
    X *p;    // Uninitialized to test try/catch for unhandled exception...
    p->get();
} catch(...) {
   cout << "Unhandled exception..";
}

Thanks.

.......................................TJ
>How-To-Repeat:
try {
    X *p;    // Uninitialized to test try/catch for unhandled exception...
    p->get();
} catch(...) {
   cout << "Unhandled exception..";
}

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list