public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "llvm at rifkin dot dev" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/86130] Expect SIGSEGV but program just silently exits
Date: Sun, 08 Oct 2023 18:38:38 +0000	[thread overview]
Message-ID: <bug-86130-4-OvQGyNz6qx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-86130-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Jeremy R. <llvm at rifkin dot dev> ---
Silently ruining the behavior of the rest of a program and leaving the
programmer to pull their hair out over what on earth is happening seems very
un-ideal behavior.

This is a very easy mistake to make and the current behavior makes tracking
down that mistake exceedingly difficult.

I do recognize the concerns here about existing programs and crashing being
arguably less friendly, but something should be done here. 

Libc++ and msvc's stl both segfault and there's some value in making the
behavior here consistent.

(In reply to Jonathan Wakely from comment #13)
> I'm not suggesting we should print "(null)", that would be crazy
Maybe, but it's also a nice middle ground between silently corrupting the
stream and crashing the program.

Throwing an exception, even only in debug, also seems reasonable as existing
programs may be able to recover from the exception without crashing.

  parent reply	other threads:[~2023-10-08 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-86130-4@http.gcc.gnu.org/bugzilla/>
2023-07-09 21:33 ` pinskia at gcc dot gnu.org
2023-07-10  8:31 ` redi at gcc dot gnu.org
2023-10-08 17:45 ` pinskia at gcc dot gnu.org
2023-10-08 18:38 ` llvm at rifkin dot dev [this message]
2023-10-08 23:15 ` llvm at rifkin dot dev

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-86130-4-OvQGyNz6qx@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).