public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ian at airs dot com" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-52205-4@http.gcc.gnu.org/bugzilla/> (raw) 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 <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> 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<char*>(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.
next reply other threads:[~2012-02-10 23:32 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-10 23:32 ian at airs dot com [this message] 2012-02-10 23:37 ` [Bug target/52205] " pinskia at gcc dot gnu.org 2012-02-11 10:48 ` ebotcazou at gcc dot gnu.org 2012-02-12 4:13 ` ian at airs dot com 2012-02-12 10:07 ` ebotcazou at gcc dot gnu.org 2012-02-12 15:33 ` ebotcazou at gcc dot gnu.org 2012-02-12 19:53 ` ian at airs dot com 2012-02-12 20:25 ` ebotcazou at gcc dot gnu.org 2012-02-14 18:39 ` [Bug target/52205] unwinding through signal handler fails ro at CeBiTec dot Uni-Bielefeld.DE 2012-02-14 22:05 ` ebotcazou at gcc dot gnu.org 2012-02-15 8:15 ` ebotcazou at gcc dot gnu.org 2012-02-15 8:17 ` ebotcazou at gcc dot gnu.org 2012-02-15 8:22 ` ebotcazou at gcc dot gnu.org 2012-02-16 19:54 ` ro at CeBiTec dot Uni-Bielefeld.DE 2012-05-26 13:56 ` ebotcazou at gcc dot gnu.org 2012-05-26 14:12 ` ebotcazou at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-52205-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).