AMD64 version of GNAT Ada compiler broken due to libthr

Kostik Belousov kostikbel at gmail.com
Fri Dec 31 12:44:24 UTC 2010


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 
> 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.
> 
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
> 
> 
> 
> 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=<value optimized out>,
>    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>=<value optimized out>)
>    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 ?? ()
> 
> _______________________________________________
> freebsd-threads at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20101231/49efc53f/attachment.pgp


More information about the freebsd-threads mailing list