>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: [email protected]
>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:
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.