From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 18 07:41:00 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E981D1065673 for ; Sun, 18 Jan 2009 07:41:00 +0000 (UTC) (envelope-from xorquewasp@googlemail.com) Received: from mail-ew0-f13.google.com (mail-ew0-f13.google.com [209.85.219.13]) by mx1.freebsd.org (Postfix) with ESMTP id 528208FC0C for ; Sun, 18 Jan 2009 07:40:59 +0000 (UTC) (envelope-from xorquewasp@googlemail.com) Received: by ewy6 with SMTP id 6so76062ewy.19 for ; Sat, 17 Jan 2009 23:40:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to; bh=4d0qVK9H9baNhyIrhtcGUOMgmDWrVx36YQGNlFajKFI=; b=NUgFFW4oNZcYjubAvhe2yxMqB35B99iw+y1Cu3iqL47ppslUDzmn4kSYpwR3uoTYhQ 86F4XET34tNBfIK0kgb1RwuWamgeDgd1/mtKDxmHr1070u6oe8kCFbTXJhzd7TkYdVdg /HHRFaXkSdKLYg9nt4ca+fzXWB6ZsE3629BD8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; b=UwDMi9Qq3qLgE4Sl5FaqmRtifHSMpxSYtNoyqnp2Ol1SFGBP85AxU15vc2TDpzDvFP PD+3NRUbetIkWOtKaRjnALtpAKVBJLgTHsicPDOSMa9ReylWJU9yHXH2zLHk3L6KoZbm pWr7i6f04RU5RTG/ZNKDLdnghDSG+nA+Eulb0= Received: by 10.210.35.17 with SMTP id i17mr5579917ebi.70.1232264459270; Sat, 17 Jan 2009 23:40:59 -0800 (PST) Received: from logik.internal.network (81-86-41-187.dsl.pipex.com [81.86.41.187]) by mx.google.com with ESMTPS id i6sm3353596gve.22.2009.01.17.23.40.58 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Jan 2009 23:40:58 -0800 (PST) Received: by logik.internal.network (Postfix, from userid 11001) id 475F65C2B; Sun, 18 Jan 2009 07:40:57 +0000 (UTC) Date: Sun, 18 Jan 2009 07:40:57 +0000 From: xorquewasp@googlemail.com To: Nate Eldredge Message-ID: <20090118074057.GB43496@logik.internal.network> References: <20090117231404.GB77134@logik.internal.network> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-hackers@freebsd.org Subject: Re: gcc 4.3.2 libgcc_s.so exception handling broken? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 07:41:01 -0000 On 2009-01-17 23:07:29, Nate Eldredge wrote: > I tried a simple example of this in C++ and it works as expected. (I am on > 7.0-RELEASE/amd64.) So it isn't completely busted, at least. > > Can you post an example that exhibits the problem? Ideally, something > complete that can be compiled and is as simple as possible. If you can do > it with C++ rather than Ada it might be easier, so people don't have to > install the Ada compiler. Also please mention the commands you use to > compile, and what they output when you compile using -v, and what > architecture you are on. Hello. You're right, the C++ example works here. I'm not sure why it didn't before. Here's a C++ version: /* main.cpp */ #include extern "C" { extern void c_function (void (*func)(int x)); } void ext_function (int x) { printf ("-- ext_function %d\n", x); throw "test_error"; } int main (void) { try { c_function (&ext_function); } catch (...) { printf ("caught test_error\n"); } return 0; } /* c_function.c */ #include void c_function (void (*func)(int x)) { printf ("-- %s enter\n", __func__); func (23); printf ("-- %s exit\n", __func__); } $ uname -smir FreeBSD 6.4-RELEASE-p1 i386 GENERIC $ gcc43 -v Using built-in specs. Target: i386-portbld-freebsd6.4 Configured with: ./..//gcc-4.3.2/configure --enable-languages=c,ada --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --program-suffix=43 --bindir=/usr/local/bin/gcc43 --libdir=/usr/local/lib/gcc-4.3.2 --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc43 --build=i386-portbld-freebsd6.4 Thread model: posix gcc version 4.3.2 (GCC) $ c++ -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.6 [FreeBSD] 20060305 $ gcc43 -o c_function.o -c c_function.c -fPIC -fexceptions -g -W -Werror -Wall -std=c99 -pedantic-errors -Wno-unused-parameter $ gcc43 -shared -Wl,-soname,c_function.so -o c_function.so c_function.o -lc $ c++ -o main.o -c main.cpp -fexceptions -g -W -Werror -Wall -pedantic-errors -Wno-unused-parameter $ c++ -o main-dynamic main.o c_function.so $ c++ -o main-static main.o c_function.o $ ./main-static -- c_function enter -- ext_function 23 caught test_error LD_LIBRARY_PATH=. ./main-dynamic -- c_function enter -- ext_function 23 caught test_error This example is problematic, however - the C++ compiler is 3.4.6 (I'm not sure how to compile a 4.3.2 gcc with C, Ada and C++ support).