From owner-freebsd-stable@FreeBSD.ORG Fri Apr 4 22:29:38 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68517106566C for ; Fri, 4 Apr 2008 22:29:38 +0000 (UTC) (envelope-from jsbrown@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by mx1.freebsd.org (Postfix) with ESMTP id 26F5C8FC20 for ; Fri, 4 Apr 2008 22:29:37 +0000 (UTC) (envelope-from jsbrown@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so264795wfa.7 for ; Fri, 04 Apr 2008 15:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=iSXDP5CuCcWSNCkDErN3KhdCL8Ek2RNRYzU/F9F0VpQ=; b=Ye3sKNLgpMfGgsd2GaSxbco+MVMnxxZjNZKZ6S80cuqGbvXowbzZ5rCoWx5F0kqRXOp9RR7XFWP9OzyxDn7IB4+J5tmcs31SJIbxf92JM2tZKMBPXYG+ppm5myDXUMB18a5g7Sru9W9KrQt82a16N6qU5pJQhfO+4xQ0DWVw0fI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=jtNF/zJKuApvLgsbPefxnjXo04Yg+9yiIbJCfOReko+pxVKIhXi9G32n3pH+tMotAPv3NkMn+5RgkMt+scksMp6L2Vg758Z1N6BIvhav7mzBoXH4BD4XhsqCkKG/iga2LVOr1JckPiXVfrLmN0MjgFkXmpwEfyTSziJw0TERU/0= Received: by 10.143.168.14 with SMTP id v14mr1332843wfo.210.1207346455894; Fri, 04 Apr 2008 15:00:55 -0700 (PDT) Received: by 10.142.218.19 with HTTP; Fri, 4 Apr 2008 15:00:55 -0700 (PDT) Message-ID: <677e3b3e0804041500l2e239891ic8634bec46e1782b@mail.gmail.com> Date: Fri, 4 Apr 2008 18:00:55 -0400 From: "Jeff Brown" To: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: library bug in gcc43 port on fbsd7 -- aborts when throwing exception 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: Fri, 04 Apr 2008 22:29:38 -0000 I believe I'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 I unsetenv LD_LIBRARY_PATH, libraries are loaded from the base fbsd7 installation in /usr/lib, which works. Thanks.