From mikulas at artax.karlin.mff.cuni.cz Mon Sep 7 00:00:06 2009 From: mikulas at artax.karlin.mff.cuni.cz (Mikulas Patocka) Date: Mon Sep 7 00:00:13 2009 Subject: threads/138603: localtime handles pthread errors badly Message-ID: <200909062356.n86Nujih005656@www.freebsd.org> >Number: 138603 >Category: threads >Synopsis: localtime handles pthread errors badly >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 Sep 07 00:00:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Mikulas Patocka >Release: 8.0-BETA3 >Organization: >Environment: not FreeBSD, I just use some of its libraries >Description: localtime function calls _pthread_key_create and treats negative value as an error. In reality, _pthread_key_create return positive number on error and zero on non-error. _pthread_key_create doesn't set errno. >How-To-Repeat: Found during source review. Could be triggered by filling-up the threadspecific key table and calling localtime(). >Fix: A patch is attached. Patch attached with submission follows: --- libc.bak/stdtime/localtime.c 2009-08-03 10:13:06.000000000 +0200 +++ libc/stdtime/localtime.c 2009-09-07 01:48:32.000000000 +0200 @@ -23,6 +23,7 @@ #include #include #include +#include #include "private.h" #include "un-namespace.h" @@ -1418,8 +1419,10 @@ if (localtime_key < 0) { _pthread_mutex_lock(&localtime_mutex); if (localtime_key < 0) { - if (_pthread_key_create(&localtime_key, free) < 0) { + int r; + if ((r = _pthread_key_create(&localtime_key, free))) { _pthread_mutex_unlock(&localtime_mutex); + errno = r; return(NULL); } } @@ -1517,8 +1520,10 @@ if (gmtime_key < 0) { _pthread_mutex_lock(&gmtime_mutex); if (gmtime_key < 0) { - if (_pthread_key_create(&gmtime_key, free) < 0) { + int r; + if ((r = _pthread_key_create(&gmtime_key, free))) { _pthread_mutex_unlock(&gmtime_mutex); + errno = r; return(NULL); } } >Release-Note: >Audit-Trail: >Unformatted: From bugmaster at FreeBSD.org Mon Sep 7 11:07:10 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 7 11:09:50 2009 Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org Message-ID: <200909071107.n87B79mi010405@freefall.freebsd.org> 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/138603 threads [libc] [patch] localtime(3) handles pthread errors bad 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 42 problems total. From edwin at FreeBSD.org Tue Sep 8 01:52:12 2009 From: edwin at FreeBSD.org (edwin@FreeBSD.org) Date: Tue Sep 8 01:52:17 2009 Subject: threads/138603: [libc] [patch] localtime(3) handles pthread errors badly Message-ID: <200909080152.n881qCTH013626@freefall.freebsd.org> Synopsis: [libc] [patch] localtime(3) handles pthread errors badly Responsible-Changed-From-To: freebsd-threads->edwin Responsible-Changed-By: edwin Responsible-Changed-When: Tue Sep 8 01:51:47 UTC 2009 Responsible-Changed-Why: Unless somebody objects, I will take care of this. Thanks to Kostik for the forwarding of it. http://www.freebsd.org/cgi/query-pr.cgi?pr=138603 From toidin at gmail.com Thu Sep 10 06:30:06 2009 From: toidin at gmail.com (toidin) Date: Thu Sep 10 06:30:12 2009 Subject: threads/138694: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 Message-ID: <200909100623.n8A6NO1U090095@www.freebsd.org> >Number: 138694 >Category: threads >Synopsis: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 10 06:30:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: toidin >Release: FreeBSD 6.3 & 6.3 Releases >Organization: IQplus Prima >Environment: System FreeBSD can not load the device, so the OS can't start so displ to login. edu:/usr/obj/usr/src/sys/SMP i386 >Description: I just loaded FreeBSD 6.3-RELEASE and 6.4-RELEASE on an IBM X 3550 M2 server, it did not recognize the onboard network adapter. I opened the case of the computer and read the top of the network card chip, it has the following numbers: Broadcom BCM5709C This server does have Two PCI-Express (x16) Gen 2 slots—one half-length, full-height and one low-profile; each slot convertible to PCI-X with riser option. Vendor id = '14e41639' vendor = 'Broadcom Corporation' device = 'NetXtreme BCM5709C Gigabit Ethernet II' class = network subclass = ethernet >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: From jhb at freebsd.org Thu Sep 10 12:48:31 2009 From: jhb at freebsd.org (John Baldwin) Date: Thu Sep 10 12:48:49 2009 Subject: threads/138694: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 In-Reply-To: <200909100623.n8A6NO1U090095@www.freebsd.org> References: <200909100623.n8A6NO1U090095@www.freebsd.org> Message-ID: <200909100848.18347.jhb@freebsd.org> On Thursday 10 September 2009 2:23:24 am toidin wrote: > > >Number: 138694 > >Category: threads > >Synopsis: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 > >Confidential: no > >Severity: serious > >Priority: high > >Responsible: freebsd-threads > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: doc-bug > >Submitter-Id: current-users > >Arrival-Date: Thu Sep 10 06:30:05 UTC 2009 > >Closed-Date: > >Last-Modified: > >Originator: toidin > >Release: FreeBSD 6.3 & 6.3 Releases > >Organization: > IQplus Prima > >Environment: > System FreeBSD can not load the device, so the OS can't start so displ to login. edu:/usr/obj/usr/src/sys/SMP i386 > >Description: > I just loaded FreeBSD 6.3-RELEASE and 6.4-RELEASE on an IBM X 3550 M2 server, it did not recognize the onboard network adapter. I opened the case of the computer and read the top of the network card chip, it has the following numbers: > > Broadcom BCM5709C > > This server does have Two PCI-Express (x16) Gen 2 slots?one half-length, full-height and one low-profile; each slot convertible to PCI-X with riser option. 5709C != 5722 (which is supported in 6.4). I believe someone recently posted some patches to hackers@ recently to add support for the 5709C for 7 and 8. -- John Baldwin From jhb at freebsd.org Thu Sep 10 12:50:03 2009 From: jhb at freebsd.org (John Baldwin) Date: Thu Sep 10 12:50:09 2009 Subject: threads/138694: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 Message-ID: <200909101250.n8ACo2Cv008907@freefall.freebsd.org> The following reply was made to PR threads/138694; it has been noted by GNATS. From: John Baldwin To: freebsd-threads@freebsd.org Cc: toidin , freebsd-gnats-submit@freebsd.org Subject: Re: threads/138694: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 Date: Thu, 10 Sep 2009 08:48:17 -0400 On Thursday 10 September 2009 2:23:24 am toidin wrote: >=20 > >Number: 138694 > >Category: threads > >Synopsis: FreeBSD 6.3 release does not recognize Broadcom BCM5722= =20 card on IBM X3550 M2 > >Confidential: no > >Severity: serious > >Priority: high > >Responsible: freebsd-threads > >State: open > >Quarter: =20 > >Keywords: =20 > >Date-Required: > >Class: doc-bug > >Submitter-Id: current-users > >Arrival-Date: Thu Sep 10 06:30:05 UTC 2009 > >Closed-Date: > >Last-Modified: > >Originator: toidin > >Release: FreeBSD 6.3 & 6.3 Releases > >Organization: > IQplus Prima > >Environment: > System FreeBSD can not load the device, so the OS can't start so displ to= =20 login. edu:/usr/obj/usr/src/sys/SMP i386 > >Description: > I just loaded FreeBSD 6.3-RELEASE and 6.4-RELEASE on an IBM X 3550 M2=20 server, it did not recognize the onboard network adapter. I opened the case= =20 of the computer and read the top of the network card chip, it has the=20 following numbers: >=20 > Broadcom BCM5709C >=20 > This server does have Two PCI-Express (x16) Gen 2 slots=97one half-length= ,=20 full-height and one low-profile; each slot convertible to PCI-X with riser= =20 option. 5709C !=3D 5722 (which is supported in 6.4). I believe someone recently po= sted=20 some patches to hackers@ recently to add support for the 5709C for 7 and 8. =2D-=20 John Baldwin From jhb at FreeBSD.org Thu Sep 10 12:53:59 2009 From: jhb at FreeBSD.org (jhb@FreeBSD.org) Date: Thu Sep 10 12:54:11 2009 Subject: kern/138694: [bge] FreeBSD 6.3 release does not recognize Broadcom BCM5709C card on IBM X3550 M2 Message-ID: <200909101253.n8ACrwji018111@freefall.freebsd.org> Old Synopsis: FreeBSD 6.3 release does not recognize Broadcom BCM5722 card on IBM X3550 M2 New Synopsis: [bge] FreeBSD 6.3 release does not recognize Broadcom BCM5709C card on IBM X3550 M2 Responsible-Changed-From-To: freebsd-threads->freebsd-bugs Responsible-Changed-By: jhb Responsible-Changed-When: Thu Sep 10 12:51:39 UTC 2009 Responsible-Changed-Why: Fixing category, etc. http://www.freebsd.org/cgi/query-pr.cgi?pr=138694 From bugmaster at FreeBSD.org Mon Sep 14 11:07:10 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 14 11:09:43 2009 Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org Message-ID: <200909141107.n8EB79xm072506@freefall.freebsd.org> 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 bugmaster at FreeBSD.org Mon Sep 21 11:07:07 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 21 11:09:40 2009 Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org Message-ID: <200909211107.n8LB75P3030446@freefall.freebsd.org> 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 ale at FreeBSD.org Tue Sep 22 16:16:20 2009 From: ale at FreeBSD.org (Alex Dupre) Date: Tue Sep 22 16:16:26 2009 Subject: how to overcome missing stubs in FreeBSD 6 Message-ID: <4AB8F211.3070707@FreeBSD.org> 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 ale at FreeBSD.org Tue Sep 22 17:13:59 2009 From: ale at FreeBSD.org (Alex Dupre) Date: Tue Sep 22 17:14:05 2009 Subject: how to overcome missing stubs in FreeBSD 6 (continued) Message-ID: <4AB905D4.6020608@FreeBSD.org> 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 ale at FreeBSD.org Tue Sep 22 17:30:22 2009 From: ale at FreeBSD.org (Alex Dupre) Date: Tue Sep 22 17:30:30 2009 Subject: how to overcome missing stubs in FreeBSD 6 (continued) In-Reply-To: <4AB905D4.6020608@FreeBSD.org> References: <4AB905D4.6020608@FreeBSD.org> Message-ID: <4AB909AC.1000707@FreeBSD.org> 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 dfilter at FreeBSD.ORG Wed Sep 23 21:40:03 2009 From: dfilter at FreeBSD.ORG (dfilter service) Date: Wed Sep 23 21:40:09 2009 Subject: threads/135673: commit references a PR Message-ID: <200909232140.n8NLe26N069252@freefall.freebsd.org> 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 dfilter at FreeBSD.ORG Fri Sep 25 00:20:06 2009 From: dfilter at FreeBSD.ORG (dfilter service) Date: Fri Sep 25 00:20:13 2009 Subject: threads/135462: commit references a PR Message-ID: <200909250020.n8P0K62G003837@freefall.freebsd.org> 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 davidxu at freebsd.org Fri Sep 25 00:40:06 2009 From: davidxu at freebsd.org (David Xu) Date: Fri Sep 25 00:40:15 2009 Subject: threads/128922: threads hang with xorg running Message-ID: <200909250040.n8P0e4MU025736@freefall.freebsd.org> 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 davidxu at FreeBSD.org Fri Sep 25 04:20:27 2009 From: davidxu at FreeBSD.org (davidxu@FreeBSD.org) Date: Fri Sep 25 04:20:33 2009 Subject: threads/135462: [PATCH] _thread_cleanupspecific() doesn't handle deleted keys Message-ID: <200909250420.n8P4KQJ5047158@freefall.freebsd.org> 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 From bugmaster at FreeBSD.org Mon Sep 28 11:07:05 2009 From: bugmaster at FreeBSD.org (FreeBSD bugmaster) Date: Mon Sep 28 11:09:34 2009 Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org Message-ID: <200909281107.n8SB74eV064185@freefall.freebsd.org> 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 p 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.