From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1525 invoked by alias); 10 Feb 2012 23:32:16 -0000 Received: (qmail 1514 invoked by uid 22791); 10 Feb 2012 23:32:15 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Feb 2012 23:32:02 +0000 From: "ian at airs dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52205] New: SPARC Solaris 2.11 unwind through signal handler fails with -fnon-call-exceptions Date: Fri, 10 Feb 2012 23:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ian at airs dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg01118.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52205 Bug #: 52205 Summary: SPARC Solaris 2.11 unwind through signal handler fails with -fnon-call-exceptions Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: ian@airs.com CC: ro@gcc.gnu.org Compile this C++ program with -fnon-call-exceptions: #include #include #include #include void die(const char* msg) { perror(msg); exit(EXIT_FAILURE); } void handler(int signo, siginfo_t* info, void *context) { printf("in handler signal %d\n", signo); throw signo; } int main(int, const char**) { struct sigaction act; memset(&act, 0, sizeof act); act.sa_sigaction = handler; sigfillset(&act.sa_mask); act.sa_flags = SA_SIGINFO; if (sigaction(SIGSEGV, &act, NULL) != 0) die("sigaction"); try { *reinterpret_cast(0) = 1; } catch (int signo) { printf("caught signal %d\n", signo); exit(EXIT_SUCCESS); } printf("did not catch\n"); exit(EXIT_FAILURE); } When this program is run, it should print something like in handler signal 11 caught signal 11 This works fine on GNU/Linux and on x86 and x86_64 Solaris 2.11. When run on SPARC Solaris 2.11, however, it prints in handler signal 11 Segmentation Fault I see this in both 32-bit and 64-bit mode. If I tweak libgcc/config/sparc/sol2-unwind.h so that sparc_is_sighandler sets *nframes to 3 rather than 2, then the test passes (I only tried this in 32-bit mode, not in 64-bit mode). The cuh_pattern test in sparc_is_sighandler does not match, so presumably it needs to be adjusted for Solaris 2.11. However, I'm not sure how to properly and safely correct it.