From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18030 invoked by alias); 8 Jan 2013 21:48:29 -0000 Received: (qmail 18021 invoked by uid 22791); 8 Jan 2013 21:48:28 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-la0-f44.google.com (HELO mail-la0-f44.google.com) (209.85.215.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Jan 2013 21:48:23 +0000 Received: by mail-la0-f44.google.com with SMTP id fr10so1028401lab.31 for ; Tue, 08 Jan 2013 13:48:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.29.10 with SMTP id f10mr26716339lbh.4.1357681701435; Tue, 08 Jan 2013 13:48:21 -0800 (PST) Received: by 10.112.125.71 with HTTP; Tue, 8 Jan 2013 13:48:21 -0800 (PST) In-Reply-To: <50EC9207.20100@gmail.com> References: <50EC4D9E.3070703@ringis.se> <50EC9207.20100@gmail.com> Date: Tue, 08 Jan 2013 21:53:00 -0000 Message-ID: Subject: Re: Problem with noexcept and incomplete backtrace From: Jonathan Wakely To: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= Cc: =?ISO-8859-1?Q?Tobias_Ringstr=F6m?= , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00062.txt.bz2 On 8 January 2013 21:39, =C1ngel Gonz=E1lez wrote: > You are lying to the compiler there. OTOH, level1 shall not throw any > exception (has noexcept), OTOH it *is* throwing an exception. So I gues > you're at undefined behavior. No, when an exception is thrown and the search for a handler finds a noexecpt function std::terminate() is called. You've missed the point of the code, the code is *supposed* to trigger abnormal termination, the point is about the quality of the backtrace available after std::terminate is called. > What about surrounding the content of level with a try catch all ? That would not help. That would lose all the context of where the exception was thrown from, so you can't inspect the backtrace (or core file) to see why an exception terminated your program. Tobias, please report it to bugzilla. The standard places no requirements on what happens except that std::terminate is called but even if it's not a bug there is room for improvement.