From owner-freebsd-threads@FreeBSD.ORG Mon Sep 21 11:07:07 2009 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 2A578106568D for ; Mon, 21 Sep 2009 11:07:07 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 186168FC19 for ; Mon, 21 Sep 2009 11:07:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LB76us030450 for ; Mon, 21 Sep 2009 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8LB75P3030446 for freebsd-threads@FreeBSD.org; Mon, 21 Sep 2009 11:07:05 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 21 Sep 2009 11:07:05 GMT Message-Id: <200909211107.n8LB75P3030446@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org 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: Mon, 21 Sep 2009 11:07:07 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o threa/136345 threads Recursive read rwlocks in thread A cause deadlock with o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 o threa/135462 threads [PATCH] _thread_cleanupspecific() doesn't handle delet o threa/133734 threads 32 bit libthr failing pthread_create() o threa/128922 threads threads hang with xorg running o threa/127225 threads bug in lib/libthr/thread/thr_init.c o threa/122923 threads 'nice' does not prevent background process from steali o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 o threa/118715 threads kse problem o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/101323 threads [patch] fork(2) in threaded programs broken. s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/83914 threads [libc] popen() doesn't work in static threaded program o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/80435 threads panic on high loads o threa/79887 threads [patch] freopen() isn't thread-safe o threa/79683 threads svctcp_create() fails if multiple threads call at the s threa/76694 threads fork cause hang in dup()/close() function in child (-l s threa/76690 threads fork hang in child for -lc_r o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/70975 threads [sysvipc] unexpected and unreliable behaviour when usi s threa/69020 threads pthreads library leaks _gc_mutex s threa/49087 threads Signals lost in programs linked with libc_r s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/34536 threads accept() blocks other threads s threa/32295 threads [libc_r] [patch] pthread(3) dont dequeue signals s threa/30464 threads pthread mutex attributes -- pshared s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o 41 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue Sep 22 16:16:20 2009 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 329D0106568B for ; Tue, 22 Sep 2009 16:16:20 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from andxor.it (relay.andxor.it [195.223.2.3]) by mx1.freebsd.org (Postfix) with SMTP id 7953E8FC1F for ; Tue, 22 Sep 2009 16:16:19 +0000 (UTC) Received: (qmail 88349 invoked from network); 22 Sep 2009 15:49:37 -0000 Received: from unknown (HELO ale.andxor.it) (192.168.2.5) by andxor.it with SMTP; 22 Sep 2009 15:49:37 -0000 Message-ID: <4AB8F211.3070707@FreeBSD.org> Date: Tue, 22 Sep 2009 17:49:37 +0200 From: Alex Dupre User-Agent: Thunderbird 2.0.0.22 (X11/20090624) MIME-Version: 1.0 To: freebsd-threads@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Subject: how to overcome missing stubs in FreeBSD 6 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: Tue, 22 Sep 2009 16:16:20 -0000 Hello, I have a scenario with a thread-safe library that uses pthread_equal() function. In FreeBSD 7+ there is the appropriate libc stub, but in FreeBSD 6 it's missing, so a single-threaded binary linked to this library should be linked also to a threading library to resolve the missing symbol. This is not good for two reasons: - additional overhead for useless threading lib - different linking between FreeBSD versions I thought that declaring pthread_equal() as weak symbol with a stub function in the library would globally solve the problem in FreeBSD 6, but actually it doesn't work as expected: a binary linked to the library with -pthread continues to use the stub function instead of the one defined in libpthread. The only way I found to make it working was to link directly to -lpthread *before* the incriminated lib, but this is not acceptable. Is there a clean solution? -- Alex Dupre From owner-freebsd-threads@FreeBSD.ORG Tue Sep 22 17:13:59 2009 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 2743D1065679 for ; Tue, 22 Sep 2009 17:13:59 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from lab.alexdupre.com (cl-506.trn-01.it.sixxs.net [IPv6:2001:1418:100:1f9::2]) by mx1.freebsd.org (Postfix) with ESMTP id A8D258FC0A for ; Tue, 22 Sep 2009 17:13:58 +0000 (UTC) Received: (qmail 28168 invoked from network); 22 Sep 2009 17:13:57 -0000 Received: from athlon.alexdupre.com (192.168.178.2) by lab.alexdupre.com with SMTP; 22 Sep 2009 17:13:57 -0000 Message-ID: <4AB905D4.6020608@FreeBSD.org> Date: Tue, 22 Sep 2009 19:13:56 +0200 From: Alex Dupre User-Agent: Thunderbird 2.0.0.19 (X11/20090112) MIME-Version: 1.0 To: freebsd-threads@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: how to overcome missing stubs in FreeBSD 6 (continued) 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: Tue, 22 Sep 2009 17:13:59 -0000 Hmmm, I saw that even in the threading libraries the pthread_* symbols are weak, why? This could explain the behavior. In the pthread_equal() case the "right != clean" thing could be to create a stub comparing the parameters instead of blindly return(1). -- Alex Dupre From owner-freebsd-threads@FreeBSD.ORG Tue Sep 22 17:30:22 2009 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 7CFE6106566C for ; Tue, 22 Sep 2009 17:30:22 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from lab.alexdupre.com (cl-506.trn-01.it.sixxs.net [IPv6:2001:1418:100:1f9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 08ACF8FC17 for ; Tue, 22 Sep 2009 17:30:21 +0000 (UTC) Received: (qmail 29574 invoked from network); 22 Sep 2009 17:30:20 -0000 Received: from athlon.alexdupre.com (192.168.178.2) by lab.alexdupre.com with SMTP; 22 Sep 2009 17:30:20 -0000 Message-ID: <4AB909AC.1000707@FreeBSD.org> Date: Tue, 22 Sep 2009 19:30:20 +0200 From: Alex Dupre User-Agent: Thunderbird 2.0.0.19 (X11/20090112) MIME-Version: 1.0 To: freebsd-threads@FreeBSD.org References: <4AB905D4.6020608@FreeBSD.org> In-Reply-To: <4AB905D4.6020608@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: how to overcome missing stubs in FreeBSD 6 (continued) 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: Tue, 22 Sep 2009 17:30:22 -0000 Alex Dupre wrote: > In the pthread_equal() case the "right != clean" thing could be to > create a stub comparing the parameters instead of blindly return(1). Maybe the following solution is better: int pthread_equal() __attribute__ ((weak)); #define pthread_equal(a,b) (pthread_equal == 0 ? 1 : pthread_equal(a,b)) -- Alex Dupre From owner-freebsd-threads@FreeBSD.ORG Wed Sep 23 21:40:03 2009 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 35B6610656F9 for ; Wed, 23 Sep 2009 21:40:03 +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 0BE298FC0A for ; Wed, 23 Sep 2009 21:40:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NLe28G069253 for ; Wed, 23 Sep 2009 21:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8NLe26N069252; Wed, 23 Sep 2009 21:40:02 GMT (envelope-from gnats) Date: Wed, 23 Sep 2009 21:40:02 GMT Message-Id: <200909232140.n8NLe26N069252@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: threads/135673: commit references a PR X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 21:40:03 -0000 The following reply was made to PR threads/135673; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/135673: commit references a PR Date: Wed, 23 Sep 2009 21:39:10 +0000 (UTC) Author: attilio Date: Wed Sep 23 21:38:57 2009 New Revision: 197445 URL: http://svn.freebsd.org/changeset/base/197445 Log: rwlock implemented from libthr need to fall through the 'hard path' and query umtx also if the shared waiters bit is set on a shared lock. The writer starvation avoidance technique, infact, can lead to shared waiters on a shared lock which can bring to a missed wakeup and thus to a deadlock if the right bit is not checked (a notable case is the writers counterpart to be handled through expired timeouts). Fix that by checking for the shared waiters bit also when unlocking the shared locks. That bug was causing a reported MySQL deadlock. Many thanks go to Nick Esborn and his employer DesertNet which provided time and machines to identify and fix this issue. PR: thread/135673 Reported by: Nick Esborn Tested by: Nick Esborn Reviewed by: jeff Modified: head/lib/libthr/thread/thr_umtx.h Modified: head/lib/libthr/thread/thr_umtx.h ============================================================================== --- head/lib/libthr/thread/thr_umtx.h Wed Sep 23 20:49:14 2009 (r197444) +++ head/lib/libthr/thread/thr_umtx.h Wed Sep 23 21:38:57 2009 (r197445) @@ -171,8 +171,11 @@ _thr_rwlock_unlock(struct urwlock *rwloc for (;;) { if (__predict_false(URWLOCK_READER_COUNT(state) == 0)) return (EPERM); - if (!((state & URWLOCK_WRITE_WAITERS) && URWLOCK_READER_COUNT(state) == 1)) { - if (atomic_cmpset_rel_32(&rwlock->rw_state, state, state-1)) + if (!((state & (URWLOCK_WRITE_WAITERS | + URWLOCK_READ_WAITERS)) && + URWLOCK_READER_COUNT(state) == 1)) { + if (atomic_cmpset_rel_32(&rwlock->rw_state, + state, state-1)) return (0); state = rwlock->rw_state; } else { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-threads@FreeBSD.ORG Fri Sep 25 00:20:06 2009 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 A79AC106566B for ; Fri, 25 Sep 2009 00:20:06 +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 96DA78FC0C for ; Fri, 25 Sep 2009 00:20:06 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P0K6XD003838 for ; Fri, 25 Sep 2009 00:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8P0K62G003837; Fri, 25 Sep 2009 00:20:06 GMT (envelope-from gnats) Date: Fri, 25 Sep 2009 00:20:06 GMT Message-Id: <200909250020.n8P0K62G003837@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: threads/135462: commit references a PR X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 00:20:06 -0000 The following reply was made to PR threads/135462; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/135462: commit references a PR Date: Fri, 25 Sep 2009 00:15:40 +0000 (UTC) Author: davidxu Date: Fri Sep 25 00:15:30 2009 New Revision: 197477 URL: http://svn.freebsd.org/changeset/base/197477 Log: don't report error if key was deleted. PR: threads/135462 Modified: head/lib/libthr/thread/thr_spec.c Modified: head/lib/libthr/thread/thr_spec.c ============================================================================== --- head/lib/libthr/thread/thr_spec.c Fri Sep 25 00:03:13 2009 (r197476) +++ head/lib/libthr/thread/thr_spec.c Fri Sep 25 00:15:30 2009 (r197477) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-threads@FreeBSD.ORG Fri Sep 25 00:40:06 2009 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 3C3DD106566B for ; Fri, 25 Sep 2009 00:40:06 +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 11FE08FC0C for ; Fri, 25 Sep 2009 00:40:06 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P0e402025737 for ; Fri, 25 Sep 2009 00:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8P0e4MU025736; Fri, 25 Sep 2009 00:40:04 GMT (envelope-from gnats) Date: Fri, 25 Sep 2009 00:40:04 GMT Message-Id: <200909250040.n8P0e4MU025736@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/128922: threads hang with xorg running 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: Fri, 25 Sep 2009 00:40:06 -0000 The following reply was made to PR threads/128922; it has been noted by GNATS. From: David Xu To: bug-followup@freebsd.org, dreigcht@gmail.com Cc: Subject: Re: threads/128922: threads hang with xorg running Date: Fri, 25 Sep 2009 08:31:10 +0800 Try to set scheduler's preemption threshold to large priority value, the default one is too low for cpu-bound application, and can starve other threads under heavy cpu load. for example: sysctl kern.sched.preempt_thresh=220 On 7.x and 8.0 kernel, I always set a large value for my Desktop PC. Regards, David Xu From owner-freebsd-threads@FreeBSD.ORG Fri Sep 25 04:20:27 2009 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 0008D1065676; Fri, 25 Sep 2009 04:20:26 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CB4258FC13; Fri, 25 Sep 2009 04:20:26 +0000 (UTC) Received: from freefall.freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8P4KQbU047226; Fri, 25 Sep 2009 04:20:26 GMT (envelope-from davidxu@freefall.freebsd.org) Received: (from davidxu@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8P4KQJ5047158; Fri, 25 Sep 2009 04:20:26 GMT (envelope-from davidxu) Date: Fri, 25 Sep 2009 04:20:26 GMT Message-Id: <200909250420.n8P4KQJ5047158@freefall.freebsd.org> To: mju@panasas.com, davidxu@FreeBSD.org, freebsd-threads@FreeBSD.org From: davidxu@FreeBSD.org Cc: Subject: Re: threads/135462: [PATCH] _thread_cleanupspecific() doesn't handle deleted keys 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, 25 Sep 2009 04:20:27 -0000 Synopsis: [PATCH] _thread_cleanupspecific() doesn't handle deleted keys State-Changed-From-To: open->patched State-Changed-By: davidxu State-Changed-When: Fri Sep 25 04:19:11 UTC 2009 State-Changed-Why: Patch committed. http://www.freebsd.org/cgi/query-pr.cgi?pr=135462