Date: Fri, 29 Feb 2008 15:38:18 -0800 From: Derek Douville <ddouville@ncircle.com> To: freebsd-threads@freebsd.org Subject: Re: Problem with 7.0-RELEASE amd64 lib32/libthr.so support of libpthread.so 32-bit binaries Message-ID: <47C8976A.4020502@ncircle.com> In-Reply-To: <47C88F3A.3020306@ncircle.com> References: <47C88F3A.3020306@ncircle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdio.h> > #include <pthread.h> > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47C8976A.4020502>