From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20596 invoked by alias); 18 May 2003 01:56:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20481 invoked by uid 71); 18 May 2003 01:56:02 -0000 Resent-Date: 18 May 2003 01:56:02 -0000 Resent-Message-ID: <20030518015602.20442.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, snowboy@orgio.net Received: (qmail 1401 invoked by uid 48); 18 May 2003 01:51:58 -0000 Message-Id: <20030518015158.1400.qmail@sources.redhat.com> Date: Sun, 18 May 2003 01:56:00 -0000 From: snowboy@orgio.net Reply-To: snowboy@orgio.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10840: any way to catch a segmentation fault error? X-SW-Source: 2003-05/txt/msg02008.txt.bz2 List-Id: >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: