public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "luke-jr+gccbugs at utopios dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug other/102993] New: -mcf-protection=full produces segfaulting code when targeting 32-bit x86 (i686) Date: Thu, 28 Oct 2021 23:56:41 +0000 [thread overview] Message-ID: <bug-102993-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102993 Bug ID: 102993 Summary: -mcf-protection=full produces segfaulting code when targeting 32-bit x86 (i686) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: luke-jr+gccbugs at utopios dot org Target Milestone: --- Generated programs, when throwing(catching?) an exception, jump to address 0 and crash. Instead, the compiler should either reject the option, ignore it, or produce working code. #include <stdexcept> void b(){ throw std::runtime_error("hi"); } int main(){ try{ b(); }catch(...){} } (gdb) bt #0 0x00401657 in ?? () #1 0x00401386 in ?? () #2 0x7b454882 in call_process_entry () from /usr/lib/wine/../i386-linux-gnu/wine/kernel32.dll.so #3 0x7b454cfc in start_process () from /usr/lib/wine/../i386-linux-gnu/wine/kernel32.dll.so #4 0x7b45488e in __wine_start_process () from /usr/lib/wine/../i386-linux-gnu/wine/kernel32.dll.so #5 0x00000000 in ?? () }catch(...){ 401657: 89 04 24 mov %eax,(%esp) 40165a: e8 49 00 00 00 call 4016a8 <___cxa_begin_catch> 40165f: c7 45 b8 ff ff ff ff movl $0xffffffff,-0x48(%ebp) 401666: e8 35 00 00 00 call 4016a0 <___cxa_end_catch> 40166b: eb d6 jmp 401643 <_main+0x5e> 40166d: 8d 45 b4 lea -0x4c(%ebp),%eax 401670: 89 04 24 mov %eax,(%esp) 401673: e8 68 10 00 00 call 4026e0 <__Unwind_SjLj_Unregister>
next reply other threads:[~2021-10-28 23:56 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-28 23:56 luke-jr+gccbugs at utopios dot org [this message] 2021-10-29 0:09 ` [Bug target/102993] -fcf-protection=full " pinskia at gcc dot gnu.org 2021-10-29 0:33 ` luke-jr+gccbugs at utopios dot org 2021-10-29 6:53 ` rguenth at gcc dot gnu.org 2021-10-29 7:05 ` ebotcazou at gcc dot gnu.org 2021-10-29 8:04 ` rguenth at gcc dot gnu.org 2021-10-29 8:08 ` ebotcazou at gcc dot gnu.org 2021-10-29 17:41 ` luke-jr+gccbugs at utopios dot org 2021-10-30 17:14 ` ebotcazou at gcc dot gnu.org 2022-12-27 7:11 ` nightstrike at gmail dot com
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-102993-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).