From owner-freebsd-threads@FreeBSD.ORG Mon May 21 11:07:25 2012 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5EBB1065672 for ; Mon, 21 May 2012 11:07:25 +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 9F2A88FC1D for ; Mon, 21 May 2012 11:07:25 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4LB7PC9049266 for ; Mon, 21 May 2012 11:07:25 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4LB7OEq049264 for freebsd-threads@FreeBSD.org; Mon, 21 May 2012 11:07:24 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 21 May 2012 11:07:24 GMT Message-Id: <201205211107.q4LB7OEq049264@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 May 2012 11:07:25 -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/165173 threads [build] clang buildworld breaks libthr o threa/163512 threads libc defaults to single threaded o threa/160708 threads possible security problem with RLIMIT_VMEM o threa/150959 threads [libc] Stub pthread_once in libc should call _libc_onc o threa/148515 threads Memory / syslog strangeness in FreeBSD 8.x ( possible o threa/141721 threads rtprio(1): (id|rt)prio priority resets when new thread o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 o threa/128922 threads threads hang with xorg running 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/116668 threads can no longer use jdk15 with libthr on -stable SMP 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. o threa/80992 threads abort() sometimes not caught by gdb depending on threa 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/30464 threads [patch] pthread mutex attributes -- pshared 20 problems total. From owner-freebsd-threads@FreeBSD.ORG Thu May 24 19:50:09 2012 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 5EAB11065740 for ; Thu, 24 May 2012 19:50:09 +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 2E2F18FC18 for ; Thu, 24 May 2012 19:50:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4OJo9Ha067898 for ; Thu, 24 May 2012 19:50:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4OJo90g067897; Thu, 24 May 2012 19:50:09 GMT (envelope-from gnats) Resent-Date: Thu, 24 May 2012 19:50:09 GMT Resent-Message-Id: <201205241950.q4OJo90g067897@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, Alexis Ballier Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B75191065670 for ; Thu, 24 May 2012 19:40:34 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 88DAF8FC1A for ; Thu, 24 May 2012 19:40:34 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OJeYYG078252 for ; Thu, 24 May 2012 19:40:34 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4OJeYih078251; Thu, 24 May 2012 19:40:34 GMT (envelope-from nobody) Message-Id: <201205241940.q4OJeYih078251@red.freebsd.org> Date: Thu, 24 May 2012 19:40:34 GMT From: Alexis Ballier To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: threads/168317: libthr: posix_mutex_trylock does not work with a PTHREAD_MUTEX_ADAPTIVE_NP thread 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: Thu, 24 May 2012 19:50:09 -0000 >Number: 168317 >Category: threads >Synopsis: libthr: posix_mutex_trylock does not work with a PTHREAD_MUTEX_ADAPTIVE_NP thread >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: Thu May 24 19:50:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Alexis Ballier >Release: 9.0-RELEASE >Organization: Gentoo >Environment: FreeBSD fbsd 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I discovered this running glib-2.32.3 testsuite. If I feed pthread_mutex_trylock with a PTHREAD_MUTEX_ADAPTIVE_NP thread, it returns EINVAL instead of EBUSY if it fails to lock. Reduced testcase: # cat mutex.c #include #include #include #include int main() { pthread_mutex_t mutex; pthread_mutexattr_t attr; int status; pthread_mutexattr_init (&attr); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP); status = pthread_mutex_init (&mutex, &attr); printf("status = %i\n", status); status = pthread_mutex_trylock(&mutex); printf("status = %i\n", status); status = pthread_mutex_trylock(&mutex); printf("status = %i\n", status); printf("%s\n", strerror(status)); } # gcc -pthread mutex.c -o mutex # ./mutex status = 0 status = 0 status = 22 Invalid argument However, with a PTHREAD_MUTEX_NORMAL thread it is fine: # cat mutex2.c #include #include #include #include int main() { pthread_mutex_t mutex; pthread_mutexattr_t attr; int status; pthread_mutexattr_init (&attr); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_NORMAL); status = pthread_mutex_init (&mutex, &attr); printf("status = %i\n", status); status = pthread_mutex_trylock(&mutex); printf("status = %i\n", status); status = pthread_mutex_trylock(&mutex); printf("status = %i\n", status); printf("%s\n", strerror(status)); } # gcc -pthread mutex2.c -o mutex2 # ./mutex2 status = 0 status = 0 status = 16 Device busy Some investigation showed that svn rev 173154 got that right but then svn rev 173173 removed this. >How-To-Repeat: Try the above testcases, or run glib-2.32.3 testsuite, or watch bailing out any glib based program using trylock. >Fix: I'm attaching a patch against head that sould fix this. Patch attached with submission follows: Index: lib/libthr/thread/thr_mutex.c =================================================================== --- lib/libthr/thread/thr_mutex.c (revision 235924) +++ lib/libthr/thread/thr_mutex.c (working copy) @@ -538,6 +538,7 @@ switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_NORMAL: + case PTHREAD_MUTEX_ADAPTIVE_NP: ret = EBUSY; break; >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Sat May 26 04:20:07 2012 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54E451065672 for ; Sat, 26 May 2012 04:20:07 +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 31C0D8FC0C for ; Sat, 26 May 2012 04:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4Q4K7Gg025287 for ; Sat, 26 May 2012 04:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4Q4K6rY025286; Sat, 26 May 2012 04:20:06 GMT (envelope-from gnats) Date: Sat, 26 May 2012 04:20:06 GMT Message-Id: <201205260420.q4Q4K6rY025286@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Jeremy Messenger Cc: Subject: Re: threads/168317: libthr: posix_mutex_trylock does not work with a PTHREAD_MUTEX_ADAPTIVE_NP thread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jeremy Messenger List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 04:20:07 -0000 The following reply was made to PR threads/168317; it has been noted by GNATS. From: Jeremy Messenger To: bug-followup@FreeBSD.org, aballier@gentoo.org Cc: Subject: Re: threads/168317: libthr: posix_mutex_trylock does not work with a PTHREAD_MUTEX_ADAPTIVE_NP thread Date: Fri, 25 May 2012 23:15:44 -0500 Thanks for find it! We have been using this patch to get the glib works. http://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi/ports-experimental/devel/glib20/files/patch-glib_gthread-posix.c Cheers, Mezz -- mezz.freebsd@gmail.com - mezz@FreeBSD.org FreeBSD GNOME Team http://www.FreeBSD.org/gnome/ - gnome@FreeBSD.org