From owner-freebsd-threads@FreeBSD.ORG Fri Dec 31 12:02:47 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 5E2A11065693 for ; Fri, 31 Dec 2010 12:02:47 +0000 (UTC) (envelope-from freebsdml@marino.st) Received: from shepard.synsport.net (mail.synsport.com [208.69.230.148]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5E68FC17 for ; Fri, 31 Dec 2010 12:02:47 +0000 (UTC) Received: from [192.168.1.33] (78.red-79-158-163.staticip.rima-tde.net [79.158.163.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id 06A9A438EC for ; Fri, 31 Dec 2010 05:46:35 -0600 (CST) Message-ID: <4D1DC299.2090808@marino.st> Date: Fri, 31 Dec 2010 12:46:33 +0100 From: John Marino User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: 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:02:47 -0000 For several months I have been getting the GNAT Ada compiler to work properly on the four major BSDs. The i386 FreeBSD, the i386 Dragonfly BSD, and the x86_64 Dragonfly BSD ports are currently perfect. The i386 and x86_64 ports of NetBSD are nearly perfect, and only lack a functional DWARF2 unwind mechanism, and the OpenBSD ports are in pretty good shape too. The progress for this work can be seen at http://www.dragonlace.net However the AMD64 FreeBSD version is unusable and it's due to libthr. I'm not sure why the i386 version works with libthr and AMD64 version doesn't. For all four BSDs, there is no configuration difference for threading between architectures. The problem seems to be with the pthread_cond_wait functionality. I've logged a test case segfault via gdb7.1 below. I would greatly appreciate some help in determining where the problem lies. If this problem can be solved, it will likely result in a perfect port of the GNAT Ada compiler for FreeBSD AMD64, something that has not existed before. Regards, John 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)] 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 0x00000008006923cc in _umtx_op_err () at /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=, mutex=0x800a0c850, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:204 #2 0x000000000040ca0f in system.tasking.stages.activate_tasks ( chain_access=0x7fffffbfebb0) at s-tassta.adb:382 #3 0x0000000000405950 in c9a009c.t1 (<_task>=) at c9a009c.adb:52 #4 0x000000000040d655 in system.tasking.stages.task_wrapper ( self_id=0x800a0c700) at s-tassta.adb:1207 #5 0x0000000800688621 in thread_start (curthread=0x800a0ae40) at /usr/src/lib/libthr/thread/thr_create.c:288 #6 0x0000000000000000 in ?? ()