From owner-freebsd-stable@FreeBSD.ORG Tue Apr 15 09:59:55 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6C0D1065673 for ; Tue, 15 Apr 2008 09:59:55 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from proxy.meer.net (proxy.meer.net [64.13.141.13]) by mx1.freebsd.org (Postfix) with ESMTP id C32818FC0C for ; Tue, 15 Apr 2008 09:59:55 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from outbound0.mx.meer.net (outbound0.mx.meer.net [209.157.153.23]) by proxy.meer.net (8.14.2/8.14.2) with ESMTP id m3F8b6U4011667 for ; Tue, 15 Apr 2008 01:37:06 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from mail.meer.net (mail.meer.net [209.157.152.14]) by outbound0.mx.meer.net (8.12.10/8.12.6) with ESMTP id m3F8L0i6085161 for ; Tue, 15 Apr 2008 01:21:02 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from mail2.meer.net (mail2.meer.net [64.13.141.16]) by mail.meer.net (8.13.3/8.13.3/meer) with ESMTP id m3F8K7DS004844 for ; Tue, 15 Apr 2008 01:20:07 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (61.204.211.246.customerlink.pwd.ne.jp [61.204.211.246]) (authenticated bits=0) by mail2.meer.net (8.14.1/8.14.1) with ESMTP id m3F8K6wV070350 for ; Tue, 15 Apr 2008 01:20:07 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Tue, 15 Apr 2008 17:20:05 +0900 Message-ID: From: gnn@freebsd.org To: stable@freebsd.org User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1.50 (i386-apple-darwin8.11.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Bayes-Prob: 0.5 (Score 0) X-Spam-Score: 1.90 (*) [Tag at 5.00] COMBINED_FROM, J_CHICKENPOX_42, J_CHICKENPOX_43, NO_REAL_NAME X-CanItPRO-Stream: default X-Canit-Stats-ID: 124629 - cbfe857ea584 X-Scanned-By: CanIt (www . roaringpenguin . com) on 64.13.141.13 Cc: Subject: A bug in g++ exceptions on 7? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 09:59:56 -0000 Howdy, We believe we've found a bug in the libgcc or libstdc++ library (not sure which one) packaged with the gcc43 port in fbsd7 on an Intel x86-64. A program linked against those libraries aborts when an exception is thrown. It does not abort if -lpthread is added to the link line, even though the program does not use threads. I believe the problem is related to the pthread stubs in libgcc, but I don't know enough to find the exact problem or fix it. An example is below. My system: >uname -a FreeBSD testlab5 7.0-STABLE FreeBSD 7.0-STABLE #1: Thu Feb 28 10:06:47 EST 2008 root@builder:/usr/obj/usr/sources/FreeBSD.7/src/sys/GENERIC amd64 >which g++43 /usr/local/bin/g++43 >g++43 --version g++43 (GCC) 4.3.1 20080313 (prerelease) etc. >echo $LD_LIBRARY_PATH /usr/local/lib/gcc-4.3.1 Sample program. When compiled with "g++43 test.cc" , it aborts upon the throw. When compiled with "g++43 test.cc -lpthread", it runs correctly. #include int main(int argc, char* argv[]) { try { throw 1; } catch (...) { printf("Caught exception\n"); } } Again, it only aborts when omitting -lpthread AND using the dynamic libs in /usr/local/lib/gcc-4.3.1. If we unsetenv LD_LIBRARY_PATH, libraries are loaded from the base fbsd7 installation in /usr/lib, which works. Thoughts? BTW We don't have a compiler issues mailing list I notice. Later, George