From owner-freebsd-threads@FreeBSD.ORG Fri Feb 29 23:38:24 2008 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 576B61065670 for ; Fri, 29 Feb 2008 23:38:24 +0000 (UTC) (envelope-from ddouville@ncircle.com) Received: from mail.ncircle.com (mail.ncircle.com [64.84.9.150]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6D08FC17 for ; Fri, 29 Feb 2008 23:38:24 +0000 (UTC) (envelope-from ddouville@ncircle.com) Received: from [192.168.40.116] (dhcp-40-116.eng.ncircle.com [192.168.40.116]) by mail.ncircle.com (8.14.2/8.14.2) with ESMTP id m1TNcIEZ077909 for ; Fri, 29 Feb 2008 15:38:18 -0800 (PST) (envelope-from ddouville@ncircle.com) Message-ID: <47C8976A.4020502@ncircle.com> Date: Fri, 29 Feb 2008 15:38:18 -0800 From: Derek Douville User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: freebsd-threads@freebsd.org References: <47C88F3A.3020306@ncircle.com> In-Reply-To: <47C88F3A.3020306@ncircle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.399 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.63 on 64.84.9.150 Subject: Re: Problem with 7.0-RELEASE amd64 lib32/libthr.so support of libpthread.so 32-bit binaries 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, 29 Feb 2008 23:38:24 -0000 Life is funny in that when you finally decide to ask the last-line of defense for help, you come across the solution. I discovered I needed to map libpthread.so.2 to libthr.so.2 (it was linked to version 3, which is what caused the backtrace below). I hope this helps someone else in the future. Thanks! -Derek Derek Douville wrote: > Hi everyone, > > I need some help with threading lib32 compat programs under 7.0, which > is supposed to fix a lot of broken areas of 6.x. We ran into > 32bit-compat threading issues under 6.2 amd64 and started testing > 7.0-RELEASE today to see if we can get a 32-bit program that was > compiled with -pthread to execute successfully. So far, this is my > environment: > > (a) FreeBSD 7.0-RELEASE amd64 installed with lib32 compatibility > (b) /usr/ports/compat6x installed > (c) /etc/libmap32.conf is empty > > The test code that revealed the threading issues under 6.x is this: > > ghost# cat pthread-crash.c > #include > #include > > void *thread(void *data) { > puts("Thread."); > return NULL; > } > > int main() { > pthread_t pth; > void *pv; > pthread_create(&pth,NULL,thread,NULL); > pthread_join(pth,&pv); > return 0; > } > > ghost# file pthread-crash > pthread-crash: ELF 32-bit LSB executable, Intel 80386, version 1 > (FreeBSD), dynamically linked (uses shared libs), not stripped > > This code, when compiled natively on FreeBSD 6.2 i386 with -pthread, > or on an amd64 platform using -m32, yields the following error > messages from my amd64-bit test system (described above): > > ghost# ./pthread-crash > Fatal error 'can not create signal daemon thread! > ' at line 236 in file /usr/src/lib/libpthread/thread/thr_sig.c (errno > = 22) > Abort (core dumped) > > (gdb) bt > #0 0x2809bacb in pthread_testcancel () > from /usr/local/lib32/compat/libpthread.so.2 > #1 0x28089972 in sigaction () from > /usr/local/lib32/compat/libpthread.so.2 > #2 0x28082cb9 in pthread_kill () from > /usr/local/lib32/compat/libpthread.so.2 > #3 0x28082534 in raise () from /usr/local/lib32/compat/libpthread.so.2 > #4 0x2817162c in abort () from /usr/local/lib32/compat/libc.so.6 > #5 0x2809c2fd in pthread_testcancel () > from /usr/local/lib32/compat/libpthread.so.2 > #6 0x28087685 in sigaction () from > /usr/local/lib32/compat/libpthread.so.2 > #7 0x2809232c in pthread_mutexattr_init () > from /usr/local/lib32/compat/libpthread.so.2 > #8 0x2808b410 in pthread_create () from > /usr/local/lib32/compat/libpthread.so.2 > #9 0x0804861e in main () > > Any help or feedback is greatly appreciated. > > -Derek > -- Derek Douville (derek@ncircle.com) Senior Platform Engineer nCircle Network Security W: +1-415-625-5990 YIM: douvilld