From owner-freebsd-current@FreeBSD.ORG Fri Jan 4 15:49:45 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 023A6A02; Fri, 4 Jan 2013 15:49:44 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id DF62C9C9; Fri, 4 Jan 2013 15:49:43 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep15-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130104154941.FLJM2598.viefep15-int.chello.at@edge03.upcmail.net>; Fri, 4 Jan 2013 16:49:41 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge03.upcmail.net with edge id jrph1k00S2xdvHc03rpha2; Fri, 04 Jan 2013 16:49:41 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 1FE9C6D454; Fri, 4 Jan 2013 16:49:41 +0100 (CET) Date: Fri, 4 Jan 2013 16:49:41 +0100 From: Stefan Farfeleder To: Dimitry Andric Subject: Re: clang 3.2 RC2 miscompiles libgcc? Message-ID: <20130104154940.GD1430@mole.fafoe.narf.at> References: <20121227150724.GA1431@mole.fafoe.narf.at> <50DC65F5.6060004@freebsd.org> <50E0BD66.4070609@FreeBSD.org> <20130102135950.GA1464@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130102135950.GA1464@mole.fafoe.narf.at> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, Nathan Whitehorn X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 15:49:45 -0000 On Wed, Jan 02, 2013 at 02:59:50PM +0100, Stefan Farfeleder wrote: > On Sun, Dec 30, 2012 at 11:17:10PM +0100, Dimitry Andric wrote: > > > > I have been playing with Stefan's testcase for a while now, and while I > > can reproduce the crashes, I am still at a loss about the cause. It > > does seem to have something to do with throwing exceptions, but I am > > still not sure whether I am looking at a bug in boost, gcc, clang, or > > libgcc... > > > > Do you happen to have a smaller testcase, by any chance? > > Not yet, but I'll try to come up with something smaller. Here's a minimal test case that reproduces the bug: $ cat throw-crash.cc #include void f2(void) { std::string s; throw std::runtime_error("foo"); } void f1(void) { f2(); } int main(void) { try { std::string s1, s2; f1(); return 0; } catch (const std::exception &) { return 1; } } $ g++ -O2 -finline-limit=0 throw-crash.cc $ ./a.out zsh: bus error (core dumped) ./a.out Stefan