From owner-freebsd-threads@FreeBSD.ORG Fri Dec 31 12:44:24 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EF31065670 for ; Fri, 31 Dec 2010 12:44:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A207F8FC08 for ; Fri, 31 Dec 2010 12:44:23 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oBVCMQKW013010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 31 Dec 2010 14:22:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oBVCMP5g099723; Fri, 31 Dec 2010 14:22:25 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oBVCMP8c099719; Fri, 31 Dec 2010 14:22:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 31 Dec 2010 14:22:25 +0200 From: Kostik Belousov To: John Marino Message-ID: <20101231122225.GK90883@deviant.kiev.zoral.com.ua> References: <4D1DC299.2090808@marino.st> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5nbaS3kz4OSBzmjj" Content-Disposition: inline In-Reply-To: <4D1DC299.2090808@marino.st> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-threads@freebsd.org Subject: Re: AMD64 version of GNAT Ada compiler broken due to libthr X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 12:44:24 -0000 --5nbaS3kz4OSBzmjj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 31, 2010 at 12:46:33PM +0100, John Marino wrote: > For several months I have been getting the GNAT Ada compiler to work=20 > properly on the four major BSDs. The i386 FreeBSD, the i386 Dragonfly=20 > BSD, and the x86_64 Dragonfly BSD ports are currently perfect. The i386= =20 > and x86_64 ports of NetBSD are nearly perfect, and only lack a=20 > functional DWARF2 unwind mechanism, and the OpenBSD ports are in pretty= =20 > good shape too. The progress for this work can be seen at=20 > http://www.dragonlace.net >=20 > However the AMD64 FreeBSD version is unusable and it's due to libthr. =20 > I'm not sure why the i386 version works with libthr and AMD64 version=20 > doesn't. For all four BSDs, there is no configuration difference for=20 > threading between architectures. >=20 > The problem seems to be with the pthread_cond_wait functionality. >=20 > I've logged a test case segfault via gdb7.1 below. I would greatly=20 > appreciate some help in determining where the problem lies. If this=20 > problem can be solved, it will likely result in a perfect port of the=20 > GNAT Ada compiler for FreeBSD AMD64, something that has not existed befor= e. >=20 First, you did not specified which version of the base system you use. Second, I suspect that the backtrace you have shown is not from the thread that generated SIGSEGV. Switch to other threads and see their backtraces, I am almost sure that there will be something more interesting. Just to be sure, in gdb, disassemble _umtx_op_err() and see which instruction is executed when SIGSEGV generated. I think that the thread with the backtrace below is sleeping in syscall. > Regards, > John >=20 >=20 >=20 > Starting program: /usr/home/marino/test_gnat/test_c9a009c/c9a009c > [New LWP 100051] > [New Thread 800a041c0 (LWP 100051)] > [New Thread 800a0ae40 (LWP 100073)] > [New Thread 800a64c80 (LWP 100080)] >=20 > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 800a64c80 (LWP 100080)] > 0x00007fffffbfeb19 in ?? () > * 4 Thread 800a64c80 (LWP 100080) 0x00007fffffbfeb19 in ?? () > 3 Thread 800a0ae40 (LWP 100073) 0x00000008006923cc in _umtx_op_err () > at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 > 2 Thread 800a041c0 (LWP 100051) 0x00000008006923cc in _umtx_op_err () > at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 > [Switching to thread 3 (Thread 800a0ae40 (LWP 100073))]#0 =20 > 0x00000008006923cc in _umtx_op_err () at=20 > /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 > 37 RSYSCALL_ERR(_umtx_op) > #0 0x00000008006923cc in _umtx_op_err () > at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 > #1 0x00000008006904c5 in cond_wait_common (cond=3D, > mutex=3D0x800a0c850, abstime=3D0x0, cancel=3D1) > at /usr/src/lib/libthr/thread/thr_cond.c:204 > #2 0x000000000040ca0f in system.tasking.stages.activate_tasks ( > chain_access=3D0x7fffffbfebb0) at s-tassta.adb:382 > #3 0x0000000000405950 in c9a009c.t1 (<_task>=3D) > at c9a009c.adb:52 > #4 0x000000000040d655 in system.tasking.stages.task_wrapper ( > self_id=3D0x800a0c700) at s-tassta.adb:1207 > #5 0x0000000800688621 in thread_start (curthread=3D0x800a0ae40) > at /usr/src/lib/libthr/thread/thr_create.c:288 > #6 0x0000000000000000 in ?? () >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" --5nbaS3kz4OSBzmjj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0dywEACgkQC3+MBN1Mb4jgiACgzoYleA1zTSTDb+eI9lMBUIvh unMAoMLsA3f0gEJj96lql/hRexoajSCm =Fx6b -----END PGP SIGNATURE----- --5nbaS3kz4OSBzmjj--