From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 14:00:11 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 E21241065673 for ; Sun, 5 Jul 2009 14:00:10 +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 AE7188FC15 for ; Sun, 5 Jul 2009 14:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n65E0A3e074935 for ; Sun, 5 Jul 2009 14:00:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n65E0Ae5074934; Sun, 5 Jul 2009 14:00:10 GMT (envelope-from gnats) Resent-Date: Sun, 5 Jul 2009 14:00:10 GMT Resent-Message-Id: <200907051400.n65E0Ae5074934@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, Rink Springer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260DA1065670 for ; Sun, 5 Jul 2009 13:54:58 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id DE0048FC12 for ; Sun, 5 Jul 2009 13:54:57 +0000 (UTC) (envelope-from rink@rink.nu) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 72FD96D423 for ; Sun, 5 Jul 2009 15:40:18 +0200 (CEST) Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DpV7L8z4iRSO for ; Sun, 5 Jul 2009 15:40:16 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id CB1286D41E; Sun, 5 Jul 2009 15:40:16 +0200 (CEST) Message-Id: <20090705134016.CB1286D41E@mx1.rink.nu> Date: Sun, 5 Jul 2009 15:40:16 +0200 (CEST) From: Rink Springer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rink Springer List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 14:00:11 -0000 >Number: 136345 >Category: threads >Synopsis: Recursive read rwlocks in thread A cause deadlock with write lock in thread B >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 05 14:00:10 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Rink Springer >Release: FreeBSD 7.2-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD gloom.rink.nu 7.2-PRERELEASE FreeBSD 7.2-PRERELEASE #1 r191417: Thu Apr 23 13:53:08 CEST 2009 rink@gloom.rink.nu:/usr/obj/extra0/sources/releng7/sys/GENERIC amd64 The problem is also present in HEAD as of today. >Description: The following program deadlocks on FreeBSD in the 'urdlck' state: --- #include #include pthread_rwlock_t rwl_lock; void* thread1(void* x) { while(1) { pthread_rwlock_rdlock(&rwl_lock); printf("read1\n"); pthread_rwlock_rdlock(&rwl_lock); printf("read2\n"); pthread_rwlock_unlock(&rwl_lock); pthread_rwlock_unlock(&rwl_lock); } return NULL; } void* thread2(void* x) { while(1) { pthread_rwlock_wrlock(&rwl_lock); printf("write\n"); pthread_rwlock_unlock(&rwl_lock); } return NULL; } int main() { pthread_t thr_1, thr_2; pthread_rwlock_init(&rwl_lock, NULL); pthread_create(&thr_1, NULL, thread1, NULL); pthread_create(&thr_1, NULL, thread2, NULL); pthread_join(thr_1, NULL); return 0; } --- The problem is that it acquires a read rwlock multiple times in one thread, and tries to acquire a write rwlock in another thread. >How-To-Repeat: $ gcc -o locktest locktest.c -pthread $ ./locktest ... output ... load: 0.00 cmd: locktest 72866 [urdlck] 1.38r 0.01u 0.00s 0% 1360k and it's deadlocked. Note that POSIX states that 'A thread may hold multiple concurrent read locks on rwlock (that is, successfully call the pthread_rwlock_rdlock() function n times). If so, the application shall ensure that the thread performs matching unlocks (that is, it calls the pthread_rwlock_unlock() function n times).', which seems to imply that the program above shouldn't deadlock. The program above works fine on Linux, yet it also seems to deadlock on Solaris 8. I have yet to check more recent versions of Solaris. >Fix: Don't Do That[tm]; it seems the only fix is to restructure the application to avoid this scenario, even though POSIX seems to allow it. >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 14:10: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 586E61065673 for ; Sun, 5 Jul 2009 14:10: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 2C3518FC14 for ; Sun, 5 Jul 2009 14:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n65EA3o8081928 for ; Sun, 5 Jul 2009 14:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n65EA3Kg081921; Sun, 5 Jul 2009 14:10:03 GMT (envelope-from gnats) Date: Sun, 5 Jul 2009 14:10:03 GMT Message-Id: <200907051410.n65EA3Kg081921@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Rink Springer Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rink Springer List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 14:10:03 -0000 The following reply was made to PR threads/136345; it has been noted by GNATS. From: Rink Springer To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B Date: Sun, 5 Jul 2009 16:03:32 +0200 Did some more testing; it works fine on Solaris 9 and 10. Also, the deadlock doesn't appear on FreeBSD 6.1-STABLE (Sep 2006). Perhaps this is a libthr issue? -- Rink P.W. Springer - http://rink.nu "Doom, gloom and despair. I like it!" - Tiresias From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 14:20:03 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 2B5731065676 for ; Sun, 5 Jul 2009 14:20:03 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id E1A9D8FC08 for ; Sun, 5 Jul 2009 14:20:02 +0000 (UTC) (envelope-from rink@rink.nu) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 2A02E6D423; Sun, 5 Jul 2009 16:03:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id imIjDtqjs9N9; Sun, 5 Jul 2009 16:03:32 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id 8611D6D41E; Sun, 5 Jul 2009 16:03:32 +0200 (CEST) Date: Sun, 5 Jul 2009 16:03:32 +0200 From: Rink Springer To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org Message-ID: <20090705140332.GA8739@rink.nu> References: <20090705134016.CB1286D41E@mx1.rink.nu> <200907051400.n65E0AWQ074917@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907051400.n65E0AWQ074917@freefall.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B 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: Sun, 05 Jul 2009 14:20:03 -0000 Did some more testing; it works fine on Solaris 9 and 10. Also, the deadlock doesn't appear on FreeBSD 6.1-STABLE (Sep 2006). Perhaps this is a libthr issue? -- Rink P.W. Springer - http://rink.nu "Doom, gloom and despair. I like it!" - Tiresias From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 15:10:37 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 7A492106566C; Sun, 5 Jul 2009 15:10:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id AB7648FC14; Sun, 5 Jul 2009 15:10:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fxm18 with SMTP id 18so2837092fxm.43 for ; Sun, 05 Jul 2009 08:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=GDu59B43IZMSW/+LJOBfn41hyFMJIV2vbKMM12X9Sos=; b=q0zjNh9d7Ov4i08qZgAsetmov7nOAfw6cToBWxSuAMOdddxmohG/rGiLAtVMVwJFtg 19yGUDd034M86hDsv2/+fELfShOY13+adKCco3FIha5vX5YrAHkeNzxJNz1xBnLaq07l E5bFh6GjgWSj44rf5BXxL4b0vyhvLvUQ0NJD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=PxxyIrt9phGLFMiKW5vDXsjEYy85hDNCqWKfMADcE0Be+pA9wtmfVcqW3UPkwGdnkD 9PptndxaJCoeOtAQz/IPVqFFcBpjVIYL8aUNKGmkj4nXdECZ27B7i8TApoknMGaKOFGP TWNATuzYzMGvvQV3/Oe73iAb6Z6i7ft5MhfcY= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.105.75 with SMTP id s11mr1610417fao.4.1246805307840; Sun, 05 Jul 2009 07:48:27 -0700 (PDT) In-Reply-To: <20090705140332.GA8739@rink.nu> References: <20090705134016.CB1286D41E@mx1.rink.nu> <200907051400.n65E0AWQ074917@freefall.freebsd.org> <20090705140332.GA8739@rink.nu> Date: Sun, 5 Jul 2009 16:48:27 +0200 X-Google-Sender-Auth: 54654600fb58c777 Message-ID: <3bbf2fe10907050748x64bb2c7dmc0787fe6bda5d701@mail.gmail.com> From: Attilio Rao To: Rink Springer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B 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: Sun, 05 Jul 2009 15:10:37 -0000 2009/7/5 Rink Springer : > Did some more testing; it works fine on Solaris 9 and 10. Also, the > deadlock doesn't appear on FreeBSD 6.1-STABLE (Sep 2006). Perhaps this > is a libthr issue? I think that rdlock_count in libthr is not updated properly. Can you test the following patch: http://www.freebsd.org/~attilio/libthr.diff Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 15:20: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 0F36D1065678 for ; Sun, 5 Jul 2009 15:20: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 952088FC0C for ; Sun, 5 Jul 2009 15:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FK26v035521 for ; Sun, 5 Jul 2009 15:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n65FK2AM035520; Sun, 5 Jul 2009 15:20:02 GMT (envelope-from gnats) Date: Sun, 5 Jul 2009 15:20:02 GMT Message-Id: <200907051520.n65FK2AM035520@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Attilio Rao Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Attilio Rao List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:20:03 -0000 The following reply was made to PR threads/136345; it has been noted by GNATS. From: Attilio Rao To: Rink Springer Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B Date: Sun, 5 Jul 2009 16:48:27 +0200 2009/7/5 Rink Springer : > Did some more testing; it works fine on Solaris 9 and 10. Also, the > deadlock doesn't appear on FreeBSD 6.1-STABLE (Sep 2006). Perhaps this > is a libthr issue? I think that rdlock_count in libthr is not updated properly. Can you test the following patch: http://www.freebsd.org/~attilio/libthr.diff Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-threads@FreeBSD.ORG Sun Jul 5 15:40:02 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 C1F531065672 for ; Sun, 5 Jul 2009 15:40:02 +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 AFF5E8FC1A for ; Sun, 5 Jul 2009 15:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n65Fe2TA052139 for ; Sun, 5 Jul 2009 15: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 n65Fe2R1052138; Sun, 5 Jul 2009 15:40:02 GMT (envelope-from gnats) Date: Sun, 5 Jul 2009 15:40:02 GMT Message-Id: <200907051540.n65Fe2R1052138@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Rink Springer Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rink Springer List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:40:03 -0000 The following reply was made to PR threads/136345; it has been noted by GNATS. From: Rink Springer To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: Re: threads/136345: Recursive read rwlocks in thread A cause deadlock with write lock in thread B Date: Sun, 5 Jul 2009 17:37:40 +0200 On Sun, Jul 05, 2009 at 03:20:02PM +0000, Attilio Rao wrote: > I think that rdlock_count in libthr is not updated properly. > Can you test the following patch: > http://www.freebsd.org/~attilio/libthr.diff This seems to resolve the issue; it seems to solve the deadlock the attached test program has. I'll retry it with my real workload and see if this fixes the problem - will let you know. Thanks! -- Rink P.W. Springer - http://rink.nu "Doom, gloom and despair. I like it!" - Tiresias From owner-freebsd-threads@FreeBSD.ORG Mon Jul 6 09:40:04 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 874F7106567A for ; Mon, 6 Jul 2009 09:40:04 +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 5A5838FC1B for ; Mon, 6 Jul 2009 09:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n669e4nS036524 for ; Mon, 6 Jul 2009 09: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 n669e463036523; Mon, 6 Jul 2009 09:40:04 GMT (envelope-from gnats) Date: Mon, 6 Jul 2009 09:40:04 GMT Message-Id: <200907060940.n669e463036523@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: threads/136345: 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: Mon, 06 Jul 2009 09:40:05 -0000 The following reply was made to PR threads/136345; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/136345: commit references a PR Date: Mon, 6 Jul 2009 09:31:15 +0000 (UTC) Author: attilio Date: Mon Jul 6 09:31:04 2009 New Revision: 195403 URL: http://svn.freebsd.org/changeset/base/195403 Log: In the current code, rdlock_count is not correctly handled for some cases. The most notable is that it is not bumped in rwlock_rdlock_common() when the hard path (__thr_rwlock_rdlock()) returns successfully. This can lead to deadlocks in libthr when rwlocks recursion in read mode happens. Fix the interested parts by correctly handling rdlock_count. PR: threads/136345 Reported by: rink Tested by: rink Reviewed by: jeff Approved by: re (kib) MFC: 2 weeks Modified: head/lib/libthr/thread/thr_rtld.c head/lib/libthr/thread/thr_rwlock.c Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Mon Jul 6 09:07:35 2009 (r195402) +++ head/lib/libthr/thread/thr_rtld.c Mon Jul 6 09:31:04 2009 (r195403) @@ -114,6 +114,7 @@ _thr_rtld_rlock_acquire(void *lock) THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_rdlock(&l->lock, 0, NULL) != 0) ; + curthread->rdlock_count++; RESTORE_ERRNO(); } @@ -148,6 +149,7 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { + curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { THR_CRITICAL_LEAVE(curthread); } else { Modified: head/lib/libthr/thread/thr_rwlock.c ============================================================================== --- head/lib/libthr/thread/thr_rwlock.c Mon Jul 6 09:07:35 2009 (r195402) +++ head/lib/libthr/thread/thr_rwlock.c Mon Jul 6 09:31:04 2009 (r195403) @@ -177,10 +177,11 @@ rwlock_rdlock_common(pthread_rwlock_t *r /* if interrupted, try to lock it in userland again. */ if (_thr_rwlock_tryrdlock(&prwlock->lock, flags) == 0) { ret = 0; - curthread->rdlock_count++; break; } } + if (ret == 0) + curthread->rdlock_count++; return (ret); } _______________________________________________ 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 Mon Jul 6 11:07:08 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 983121065675 for ; Mon, 6 Jul 2009 11:07:08 +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 7C0688FC1E for ; Mon, 6 Jul 2009 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n66B78s3010959 for ; Mon, 6 Jul 2009 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n66B77b5010955 for freebsd-threads@FreeBSD.org; Mon, 6 Jul 2009 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 6 Jul 2009 11:07:07 GMT Message-Id: <200907061107.n66B77b5010955@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, 06 Jul 2009 11:07:09 -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/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 40 problems total.