From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 928CD3858D35; Sun, 8 Oct 2023 18:38:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 928CD3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696790320; bh=HUPEa9Ocz90fHuyBvo+zD2MZADx76cr0tOmKO35x/bc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BkoGNCvlbN0vrTwGN5sj7H4APo3u/ZT8A9n6zxMp00PvGf2WtM0OgP+kkmM15sN7n t7F1eXn6wapoRKNd4JIlPJvWdEZZhuu8NMoghtergMjrxVRKmpGIoJ9bOjsbp1G3Sj lNh+9KCOymy9i+TupNIkCY899+e7kYl43pMW+b8g= From: "llvm at rifkin dot dev" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 8.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: llvm at rifkin dot dev X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D86130 --- Comment #20 from Jeremy R. --- 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.=20 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.=