From owner-cvs-all@FreeBSD.ORG Tue Nov 2 23:40:50 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A63216A4E0; Tue, 2 Nov 2004 23:40:44 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9F2343D5A; Tue, 2 Nov 2004 23:40:43 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) iA2Neb8N009722; Tue, 2 Nov 2004 18:40:37 -0500 (EST) Date: Tue, 2 Nov 2004 18:40:37 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: David Xu In-Reply-To: <418817ED.2040201@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: src-committers@freebsd.org cc: Julian Elischer cc: John Baldwin Subject: Re: cvs commit: src/lib/libpthread/thread thr_private.h thr_sig.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2004 23:40:51 -0000 On Wed, 3 Nov 2004, David Xu wrote: > John Baldwin wrote: > > >On Monday 01 November 2004 06:04 pm, David Xu wrote: > > > > > >>Not every important, I think I have another very important history > >>bug in hand, did you get my "fix famous libpthread conditional > >>variable race condition" mail ? :-) > >> > >> > > > >Oooo, can I test it please? We are still having problems with mono on HEAD > >here at work. I tried merging the changes in uthread_cond.c 1.32 to > >libpthread but that seemed to make it worse. The problems seem to be that a > >signal handler is being run when the SYNCQ sflag is set (but the thread is > >not on a cv or a mutex queue), and the handler calls sem_post() which is > >supposed to be signal safe. sem_post() tries to lock a mutex and then bombs > >with the assertion failure. > > > > > > > You can try: > http://people.freebsd.org/~davidxu/kse/thr_cond.c.diff > > But it was not designed to fix the problem you have seen. :-) I think if _kse_critical_leave() were replaced by _kcb_critical_leave() at around line 676 in thr_kern.c, that should fix the problem, no? There's no reason to do a yield check after leaving the scheduler, and the check for signals and cancellation is done right after that point before returning. -- Dan Eischen