From owner-freebsd-threads@FreeBSD.ORG Wed Mar 5 03:30:08 2008 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95934106566C for ; Wed, 5 Mar 2008 03:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF898FC1F for ; Wed, 5 Mar 2008 03:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m253U8rc021684 for ; Wed, 5 Mar 2008 03:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m253U88M021681; Wed, 5 Mar 2008 03:30:08 GMT (envelope-from gnats) Date: Wed, 5 Mar 2008 03:30:08 GMT Message-Id: <200803050330.m253U88M021681@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/121343: pthread_cond_wait hanging in libthr X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 03:30:08 -0000 The following reply was made to PR threads/121343; it has been noted by GNATS. From: David Xu To: josh.carroll@gmail.com Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: threads/121343: pthread_cond_wait hanging in libthr Date: Wed, 05 Mar 2008 11:30:06 +0800 Josh Carroll wrote: >> I don't know what really happened, but if your program is using >> threads, it is better to link it with thread library directly. >> Can you dump ldd result ? > > /usr/local/bin/ushare: > libupnp.so.3 => /usr/local/lib/libupnp.so.3 (0x4063d000) > libthreadutil.so.4 => /usr/local/lib/libthreadutil.so.4 (0x40771000) > libixml.so.2 => /usr/local/lib/libixml.so.2 (0x40877000) > libc.so.7 => /lib/libc.so.7 (0x40982000) > libthr.so.3 => /lib/libthr.so.3 (0x40b97000) > liblwres.so.30 => /usr/lib/liblwres.so.30 (0x40cac000) > OK. >> I have ushare up and running: >> apple# ps xaHl | grep ushare >> apple# sockstat -4l > > root@pflog:~# ushare -D > root@pflog:~# ps xaHl | grep ushare > 0 14812 1 0 44 0 9260 1552 umtxn Ss ?? 0:00.00 ushare -D > 0 14812 1 0 44 0 9260 1552 umtxn Ss ?? 0:00.00 ushare -D > 0 14968 12265 0 44 0 5864 1160 - R+ p0 0:00.00 grep ushare > root@pflog:~# sockstat -4l | grep ushare > > I created a new ushare.conf for the above, which contains only: > > USHARE_NAME=test > USHARE_IFACE=em1 > USHARE_PORT= > USHARE_DIR=/tmp > USHARE_OVERRIDE_ICONV_ERR= > > Thanks, > Josh > I added -lpthread to link command (I found you don't have it), and this is why it works on my machine, you might try it. cc -I/usr/local/include -O2 -fno-strict-aliasing -pipe -Wall -W -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -L/usr/local/lib -o ushare cds.o cms.o msr.o http.o presentation.o metadata.o mime.o services.o buffer.o util_iconv.o content.o cfgparser.o trace.o redblack.o osdep.o ushare.o -lupnp - lthreadutil -lixml -lpthread