public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "matteo at mitalia dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/113337] Uncaught rethrown exceptions don't invoke std::terminate if SEH-based unwinding is used
Date: Mon, 15 Jan 2024 15:17:42 +0000	[thread overview]
Message-ID: <bug-113337-4-YgKoRI9crW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113337-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113337

--- Comment #1 from Matteo Italia <matteo at mitalia dot net> ---
Looking at this a bit deeper, I think that just putting a `return` in front of
`_Unwind_RaiseException (exc);` should be enough.

The bulk of the phase2 stuff that is done in unwind.inc for
`_Unwind_Resume_or_Rethrow`, i.e.

```
  gcc_assert (code == _URC_INSTALL_CONTEXT);

  uw_install_context (&this_context, &cur_context, frames);
```

is done directly in `_GCC_specific_handler`, and indeed if _that_ doesn't work
`_Unwind_ForcedUnwind_Phase2` can return only `_URC_END_OF_STACK` anyhow, which
would go to the `gcc_assert` codepath in unwind.inc.

  reply	other threads:[~2024-01-15 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 17:00 [Bug libgcc/113337] New: Rethrown uncaught " matteo at mitalia dot net
2024-01-15 15:17 ` matteo at mitalia dot net [this message]
2024-01-15 15:19 ` [Bug libgcc/113337] Uncaught rethrown " matteo at mitalia dot net
2024-02-06  8:24 ` cvs-commit at gcc dot gnu.org
2024-02-19 14:10 ` jyong 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-113337-4-YgKoRI9crW@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: link
Be 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).