From owner-freebsd-threads@FreeBSD.ORG Mon Apr 4 07:53:54 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F21516A4CE for ; Mon, 4 Apr 2005 07:53:54 +0000 (GMT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 429AE43D5C for ; Mon, 4 Apr 2005 07:53:53 +0000 (GMT) (envelope-from bel@orel.ru) Received: from orel.ru (pf1.net.orel.ru [213.59.64.75]) by tts.orel.ru (8.13.1/8.13.1/bel) with ESMTP id j347riXb019172; Mon, 4 Apr 2005 11:53:45 +0400 Message-ID: <4250F283.5020005@orel.ru> Date: Mon, 04 Apr 2005 11:53:39 +0400 From: Andrew Belashov Organization: ORIS User-Agent: Mozilla/5.0 (X11; U; FreeBSD sparc64; en-US; rv:1.6) Gecko/20040407 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <20050401223744.GA6096@crodrigues.org> In-Reply-To: <20050401223744.GA6096@crodrigues.org> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Zombi-Check: on netra2.orel.ru cc: freebsd-threads@freebsd.org Subject: Re: New Nvidia drivers with KSE support X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 07:53:54 -0000 Hello! Craig Rodrigues wrote: > I just saw on http://bsdnews.com that Nvidia has new drivers > for FreeBSD 5.x, and these drivers supposedly support KSE: > > http://bsdnews.com/view_story.php3?story_id=4944 > > So is this one less reason to keep libc_r around in the tree? ;) libc_r is default for sparc64. libpthread (KSE) is broken for sparc64. libthr is unstable for sparc64. -- With Best Regards, Andrew Belashov. From owner-freebsd-threads@FreeBSD.ORG Mon Apr 4 11:01:57 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB2AC16A4F8 for ; Mon, 4 Apr 2005 11:01:57 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8641843D49 for ; Mon, 4 Apr 2005 11:01:57 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j34B1vCk012297 for ; Mon, 4 Apr 2005 11:01:57 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j34B1u3E012291 for freebsd-threads@freebsd.org; Mon, 4 Apr 2005 11:01:56 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 4 Apr 2005 11:01:56 GMT Message-Id: <200504041101.j34B1u3E012291@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 11:01:57 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2004/04/22] threads/65883threads libkse's sigwait does not work after fork o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -lthr) 2 problems total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] kern/20861 threads libc_r does not honor socket timeouts o [2001/01/20] threads/24472threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] threads/24632threads libc_r delicate deviation from libc in ha o [2001/01/25] kern/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] threads/34536threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] threads/39922threads [PATCH?] Threaded applications executed w o [2002/08/04] kern/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] threads/48856threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] threads/49087threads Signals lost in programs linked with libc o [2003/05/08] threads/51949threads thread in accept cannot be cancelled s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when o [2004/09/14] threads/71725threads Mysql Crashes frequently giving Sock Erro o [2004/10/05] threads/72353threads Assertion fails in /usr/src/lib/libpthrea o [2004/10/07] threads/72429threads threads blocked in stdio (fgets, etc) are o [2004/10/21] threads/72953threads fork() unblocks blocked signals w/o PTHRE o [2004/11/25] threads/74370threads Cannot get lwp 0 registers in gdb o [2004/12/08] threads/74856threads dig/host broken w/ libthr o [2004/12/19] threads/75273threads FBSD 5.3 libpthread (KSE) bug o [2004/12/21] threads/75374threads pthread_kill() ignores SA_SIGINFO flag o [2005/01/04] threads/75795threads applications linked with -lc_r can't clos o [2005/01/26] threads/76694threads fork cause hang in dup()/close() function o [2005/03/10] threads/78660threads Java hangs unkillably in STOP state after 26 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/26] kern/18824 threads gethostbyname is not thread safe o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2000/10/21] kern/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] threads/30464threads pthread mutex attributes -- pshared o [2002/05/02] threads/37676threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] threads/40671threads pthread_cancel doesn't remove thread from o [2004/07/13] threads/69020threads pthreads library leaks _gc_mutex o [2004/09/21] threads/71966threads Mlnet Core Dumped : Fatal error '_pq_inse o [2004/11/21] threads/74180threads KSE problem. Applications those riched ma o [2005/01/20] threads/76513threads libpthread is not working o [2005/01/29] threads/76821threads Add access to gdb unique thread id o [2005/02/01] threads/76938threads include/unistd.h: ttyname_r prototype mis 12 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Apr 4 11:56:55 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4148216A4CE for ; Mon, 4 Apr 2005 11:56:55 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E80543D39; Mon, 4 Apr 2005 11:56:55 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j34Bulg2022094; Mon, 4 Apr 2005 11:56:51 GMT (envelope-from davidxu@freebsd.org) Message-ID: <42512B7D.3050700@freebsd.org> Date: Mon, 04 Apr 2005 19:56:45 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050306 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Belashov References: <20050401223744.GA6096@crodrigues.org> <4250F283.5020005@orel.ru> In-Reply-To: <4250F283.5020005@orel.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: New Nvidia drivers with KSE support X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 11:56:55 -0000 Andrew Belashov wrote: > Hello! > > Craig Rodrigues wrote: > >> I just saw on http://bsdnews.com that Nvidia has new drivers >> for FreeBSD 5.x, and these drivers supposedly support KSE: >> >> http://bsdnews.com/view_story.php3?story_id=4944 >> >> So is this one less reason to keep libc_r around in the tree? ;) > > > libc_r is default for sparc64. > libpthread (KSE) is broken for sparc64. > libthr is unstable for sparc64. > Can you try newest libthr on sparc64 ? > -- > With Best Regards, > Andrew Belashov. > David Xu From owner-freebsd-threads@FreeBSD.ORG Mon Apr 4 12:40:13 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E55F516A4CE for ; Mon, 4 Apr 2005 12:40:12 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4B6B43D55 for ; Mon, 4 Apr 2005 12:40:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j34CeCWI029084 for ; Mon, 4 Apr 2005 12:40:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j34CeCoV029083; Mon, 4 Apr 2005 12:40:12 GMT (envelope-from gnats) Resent-Date: Mon, 4 Apr 2005 12:40:12 GMT Resent-Message-Id: <200504041240.j34CeCoV029083@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kimmo Mustonen Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE90216A4CE for ; Mon, 4 Apr 2005 12:36:05 +0000 (GMT) Received: from i2-138.rommon.fi (i2-138.rommon.fi [195.163.185.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 093C943D5C for ; Mon, 4 Apr 2005 12:36:05 +0000 (GMT) (envelope-from tzimmo@i2-138.rommon.fi) Received: from i2-138.rommon.fi (localhost [127.0.0.1]) by i2-138.rommon.fi (8.13.1/8.13.1) with ESMTP id j34Ca2GU002334 for ; Mon, 4 Apr 2005 15:36:02 +0300 (EEST) (envelope-from tzimmo@i2-138.rommon.fi) Received: (from tzimmo@localhost) by i2-138.rommon.fi (8.13.1/8.13.1/Submit) id j34Ca2JB002333; Mon, 4 Apr 2005 15:36:02 +0300 (EEST) (envelope-from tzimmo) Message-Id: <200504041236.j34Ca2JB002333@i2-138.rommon.fi> Date: Mon, 4 Apr 2005 15:36:02 +0300 (EEST) From: Kimmo Mustonen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: threads/79526: A memory leak in pthread_rwlock_init() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Kimmo Mustonen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 12:40:13 -0000 >Number: 79526 >Category: threads >Synopsis: A memory leak in pthread_rwlock_init() >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 04 12:40:12 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Kimmo Mustonen >Release: FreeBSD 5.3-RELEASE-p6 i386 >Organization: ROMmon Oy >Environment: System: FreeBSD tzimmopassive.rommon.fi 5.3-RELEASE-p6 FreeBSD 5.3-RELEASE-p6 #10: Thu Mar 31 14:43:05 EEST 2005 root@tzimmopassive.rommon.fi:/usr/src/sys/i386/compile/ROMMON-PROBE5 i386 Pentium 4, FreeBSD 5.3, i386, pthread >Description: Calling pthread_rwlock_init() leaks memory each time it is called. Example code ---8<---8<--- #include /* start using valgrind: valgrind --tool=memcheck -v --leak-check=yes --show-reachable=yes \ --num-callers=100 ./leak_pthread_1 */ int main(void) { int i; pthread_rwlock_t lock; for (i = 0; i < 100; i++) { pthread_rwlock_init(&lock, NULL); pthread_rwlock_destroy(&lock); } return 0; } ---8<---8<--- and valgrind report ---8<---8<--- ==801== 2012 bytes in 301 blocks are still reachable in loss record 1 of 1 ==801== at 0x3C033183: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck.so) ==801== by 0x3C03A8D0: (within /usr/local/lib/valgrind/libpthread.so.1) ==801== by 0x3C03BF49: pthread_mutex_init (in /usr/local/lib/valgrind/libpthread.so.1) ==801== by 0x3C03BFA9: pthread_mutex_lock (in /usr/local/lib/valgrind/libpthread.so.1) ==801== by 0x3C03F174: (within /usr/local/lib/valgrind/libpthread.so.1) ==801== by 0x3C03F2D9: pthread_rwlock_init (in /usr/local/lib/valgrind/libpthread.so.1) ==801== by 0x8048609: main (leak_pthread_1.c:14) ==801== ---8<---8<--- >How-To-Repeat: Run the example code using valgrind. >Fix: Haven't looked at the sources, but probably easy to fix. I suppose pthread_rwlock_destroy() just does not free all the resources pthread_rwlock_init() allocates. >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Mon Apr 4 20:30:11 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A54BC16A4CE for ; Mon, 4 Apr 2005 20:30:11 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D3AD43D39 for ; Mon, 4 Apr 2005 20:30:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j34KUBZP023434 for ; Mon, 4 Apr 2005 20:30:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j34KUBM0023433; Mon, 4 Apr 2005 20:30:11 GMT (envelope-from gnats) Date: Mon, 4 Apr 2005 20:30:11 GMT Message-Id: <200504042030.j34KUBM0023433@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Craig Rodrigues Subject: Re: threads/79526: A memory leak in pthread_rwlock_init() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Craig Rodrigues List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 20:30:11 -0000 The following reply was made to PR threads/79526; it has been noted by GNATS. From: Craig Rodrigues To: Kimmo Mustonen Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: threads/79526: A memory leak in pthread_rwlock_init() Date: Mon, 4 Apr 2005 16:25:40 -0400 On Mon, Apr 04, 2005 at 03:36:02PM +0300, Kimmo Mustonen wrote: > Haven't looked at the sources, but probably easy to fix. > I suppose pthread_rwlock_destroy() just does not free all the > resources pthread_rwlock_init() allocates. Can you try this patch? prwlock was being allocated by malloc inside pthread_rwlock_init(), but never freed. --- lib/libpthread/thread/thr_rwlock.c.orig Mon Apr 4 16:22:16 2005 +++ lib/libpthread/thread/thr_rwlock.c Mon Apr 4 16:23:26 2005 @@ -131,6 +131,7 @@ prwlock->blocked_writers = 0; *rwlock = prwlock; + free(prwlock); } } } -- Craig Rodrigues rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Tue Apr 5 09:20:06 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F33216A4D0 for ; Tue, 5 Apr 2005 09:20:06 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6A3343D1F for ; Tue, 5 Apr 2005 09:20:05 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j359K5CS069487 for ; Tue, 5 Apr 2005 09:20:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j359K5l0069486; Tue, 5 Apr 2005 09:20:05 GMT (envelope-from gnats) Date: Tue, 5 Apr 2005 09:20:05 GMT Message-Id: <200504050920.j359K5l0069486@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Kimmo Mustonen Subject: Re: threads/79526: A memory leak in pthread_rwlock_init() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Kimmo Mustonen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2005 09:20:06 -0000 The following reply was made to PR threads/79526; it has been noted by GNATS. From: Kimmo Mustonen To: Craig Rodrigues Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: threads/79526: A memory leak in pthread_rwlock_init() Date: Tue, 5 Apr 2005 12:14:17 +0300 (EEST) On Mon, 4 Apr 2005, Craig Rodrigues wrote: > Can you try this patch? > prwlock was being allocated by malloc inside pthread_rwlock_init(), > but never freed. > *rwlock = prwlock; > + free(prwlock); First, this patch is broken. It sets the pointer to a datastructure but frees the contents of the structure immediately after that, later causing referencing to deallocated memory and crashing. The valgrind version did not crash but still leaked memory after this (broken) patch. I didn't realise valgrind has its own pthread library. Thus, the problem is most probably in the valgrind implementation of pthread library and the actual pthread library does not leak. So I don't think there's a need for a patch in pthread. I hope this problem will disappear when the new valgrind using native pthread library is ported to FreeBSD. Regards, Kimmo Mustonen From owner-freebsd-threads@FreeBSD.ORG Tue Apr 5 12:28:07 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6A1316A4CE; Tue, 5 Apr 2005 12:28:07 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C44743D1D; Tue, 5 Apr 2005 12:28:07 +0000 (GMT) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j35CS70C094560; Tue, 5 Apr 2005 12:28:07 GMT (envelope-from davidxu@freefall.freebsd.org) Received: (from davidxu@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j35CS55V094556; Tue, 5 Apr 2005 12:28:05 GMT (envelope-from davidxu) Date: Tue, 5 Apr 2005 12:28:05 GMT From: David Xu Message-Id: <200504051228.j35CS55V094556@freefall.freebsd.org> To: slw@zxy.spb.ru, davidxu@FreeBSD.org, freebsd-threads@FreeBSD.org Subject: Re: threads/74856: dig/host broken w/ libthr X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2005 12:28:07 -0000 Synopsis: dig/host broken w/ libthr State-Changed-From-To: open->closed State-Changed-By: davidxu State-Changed-When: Tue Apr 5 12:25:57 GMT 2005 State-Changed-Why: Can not reproduce in -CURRENT with newest libthr. http://www.freebsd.org/cgi/query-pr.cgi?pr=74856 From owner-freebsd-threads@FreeBSD.ORG Tue Apr 5 12:50:44 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20DC016A4CF; Tue, 5 Apr 2005 12:50:44 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E93A143D1F; Tue, 5 Apr 2005 12:50:43 +0000 (GMT) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j35Cohi4097038; Tue, 5 Apr 2005 12:50:43 GMT (envelope-from davidxu@freefall.freebsd.org) Received: (from davidxu@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j35CohbB097034; Tue, 5 Apr 2005 12:50:43 GMT (envelope-from davidxu) Date: Tue, 5 Apr 2005 12:50:43 GMT From: David Xu Message-Id: <200504051250.j35CohbB097034@freefall.freebsd.org> To: s_sourceforge@nedprod.com, davidxu@FreeBSD.org, freebsd-threads@FreeBSD.org Subject: Re: threads/76821: Add access to gdb unique thread id X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2005 12:50:44 -0000 Synopsis: Add access to gdb unique thread id State-Changed-From-To: open->closed State-Changed-By: davidxu State-Changed-When: Tue Apr 5 12:49:34 GMT 2005 State-Changed-Why: Fixed by printing thread address in gdb. http://www.freebsd.org/cgi/query-pr.cgi?pr=76821 From owner-freebsd-threads@FreeBSD.ORG Tue Apr 5 17:48:30 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BB3316A4CE for ; Tue, 5 Apr 2005 17:48:30 +0000 (GMT) Received: from mailhost.gigave.com (mailhost.gigave.com [38.113.228.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C0F943D49 for ; Tue, 5 Apr 2005 17:48:30 +0000 (GMT) (envelope-from sean@sean.gigave.com) Date: Tue, 5 Apr 2005 10:48:28 -0700 From: Sean Chittenden To: threads@FreeBSD.org Message-ID: <20050405174828.GQ1527@sean.gigave.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: pthread_acquire() still having issues? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2005 17:48:30 -0000 I'd nearly call this Nagios FUD, but since I haven't seen anything about this I thought I'd as for the record. From the Known Issues section on: http://nagios.sourceforge.net/docs/2_0/whatsnew.html "There are a few known issues with the Nagios 2.0 code at the moment. Hopefully some of these will be fixed before 2.0 is released as stable... FreeBSD and threads. On FreeBSD there's a native user-level implementation of threads called 'pthread' and there's also an optional ports collection 'linuxthreads' that uses kernel hooks. Some folks from Yahoo! have reported that using the pthread library causes Nagios to pause under heavy I/O load, causing some service check results to be lost. Switching to linuxthreads seems to help this problem, but not fix it. The lock happens in liblthread's __pthread_acquire() - it can't ever acquire the spinlock. It happens when the main thread forks to execute an active check. On the second fork to create the grandchild, the grandchild is created by fork, but never returns from liblthread's fork wrapper, because it's stuck in __pthread_acquire(). Maybe some FreeBSD users can help out with this problem." I cruised through the lists and didn't see anything. Has this been addressed or is this still a current issue that folks are aware of? -sc -- Sean Chittenden From owner-freebsd-threads@FreeBSD.ORG Tue Apr 5 18:12:09 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 073AE16A4CE for ; Tue, 5 Apr 2005 18:12:09 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6437943D31 for ; Tue, 5 Apr 2005 18:12:07 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.134] (h86.vuokselantie10.fi [193.64.42.134]) by silver.he.iki.fi (8.13.1/8.11.4) with ESMTP id j35IC5tJ034169; Tue, 5 Apr 2005 21:12:05 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <4252D50C.3000007@he.iki.fi> Date: Tue, 05 Apr 2005 21:12:28 +0300 From: Petri Helenius User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean Chittenden References: <20050405174828.GQ1527@sean.gigave.com> In-Reply-To: <20050405174828.GQ1527@sean.gigave.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: threads@freebsd.org Subject: Re: pthread_acquire() still having issues? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2005 18:12:09 -0000 That refers to the linuxthreads issue, right? It does not describe the alleged pthread issue to any great detail. Pete Sean Chittenden wrote: >I'd nearly call this Nagios FUD, but since I haven't seen anything >about this I thought I'd as for the record. From the Known Issues >section on: > >http://nagios.sourceforge.net/docs/2_0/whatsnew.html > >"There are a few known issues with the Nagios 2.0 code at the >moment. Hopefully some of these will be fixed before 2.0 is released >as stable... FreeBSD and threads. On FreeBSD there's a native >user-level implementation of threads called 'pthread' and there's also >an optional ports collection 'linuxthreads' that uses kernel >hooks. Some folks from Yahoo! have reported that using the pthread >library causes Nagios to pause under heavy I/O load, causing some >service check results to be lost. Switching to linuxthreads seems to >help this problem, but not fix it. The lock happens in liblthread's >__pthread_acquire() - it can't ever acquire the spinlock. It happens >when the main thread forks to execute an active check. On the second >fork to create the grandchild, the grandchild is created by fork, but >never returns from liblthread's fork wrapper, because it's stuck in >__pthread_acquire(). Maybe some FreeBSD users can help out with this >problem." > >I cruised through the lists and didn't see anything. Has this been >addressed or is this still a current issue that folks are aware of? >-sc > > > From owner-freebsd-threads@FreeBSD.ORG Fri Apr 8 14:30:23 2005 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D222C16A4F3 for ; Fri, 8 Apr 2005 14:30:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 158BA43D46 for ; Fri, 8 Apr 2005 14:30:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j38EUKs4020845 for ; Fri, 8 Apr 2005 14:30:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j38EUKAe020844; Fri, 8 Apr 2005 14:30:20 GMT (envelope-from gnats) Resent-Date: Fri, 8 Apr 2005 14:30:20 GMT Resent-Message-Id: <200504081430.j38EUKAe020844@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steve Sears Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8269C16A4CE for ; Fri, 8 Apr 2005 14:28:50 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E25043D39 for ; Fri, 8 Apr 2005 14:28:50 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j38ESok1077372 for ; Fri, 8 Apr 2005 14:28:50 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j38ESoUK077371; Fri, 8 Apr 2005 14:28:50 GMT (envelope-from nobody) Message-Id: <200504081428.j38ESoUK077371@www.freebsd.org> Date: Fri, 8 Apr 2005 14:28:50 GMT From: Steve Sears To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: threads/79683: svctcp_create() fails if multiple threads call at the same time, it's not thread-safe X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2005 14:30:23 -0000 >Number: 79683 >Category: threads >Synopsis: svctcp_create() fails if multiple threads call at the same time, it's not thread-safe >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 08 14:30:20 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Steve Sears >Release: 5.3-STABLE, 5.4-STABLE >Organization: self >Environment: FreeBSD sjs-bsd 5.4-STABLE FreeBSD 5.4-STABLE #17: Thu Apr 7 08:15:24 EDT 2005 root@sjs-bsd:/usr/src/sys-sjs/i386/compile/SJSKERN i386 >Description: The svctcp_create() function returns NULL if it fails to create a TCP/IP-based RPC service transport for the server. On BSD, this function often fails when several threads concurrently try to register as servers. When it begins to fail, subsequent retries very rarely work (although I have seen it happen). I frequently see svctcp_create() fail (returns NULL). SVCXPRT *transp =svctcp_create(sockfd, 0, 0); with the syslog message "Could not get tcp transport" frmom the code lib/rpc code: static SVCXPRT * svc_com_create(fd, sendsize, recvsize, netid) .. if ((nconf = __rpc_getconfip(netid)) == NULL) { (void) syslog(LOG_ERR, "Could not get %s transport", netid); return (NULL); } The culprit appears to be the setnetconfig(), getnetconfig(), endnetconfig() code used by __rpc_getconfip(netid). The setnetconfig() returns a handle, accessed through getnetconifg(), and terminated by endnetconfig(). This scary code attempts to share in-memory structures and an open file pointer with multiple accessing threads, but it appears that not all access paths guarantee that all the data will be available for the other threads. >How-To-Repeat: Don't have a small test program, sorry. Our program creates 5 listener threads, which try to invoke this code are roughly the same time. >Fix: Staggering the threads by 1 second and invoking lots of retries seems to work. But it's ugly! >Release-Note: >Audit-Trail: >Unformatted: