From owner-freebsd-stable@FreeBSD.ORG Sat Oct 23 14:54:44 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B23916A4CE for ; Sat, 23 Oct 2004 14:54:44 +0000 (GMT) Received: from gen129.n001.c02.escapebox.net (gen129.n001.c02.escapebox.net [213.73.91.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4255043D3F for ; Sat, 23 Oct 2004 14:54:44 +0000 (GMT) (envelope-from gemini@geminix.org) Message-ID: <417A70B1.50009@geminix.org> Date: Sat, 23 Oct 2004 16:54:41 +0200 From: Uwe Doering Organization: Private UNIX Site User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041002 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-stable@freebsd.org References: <20041023003246.Y91215@is.park.rambler.ru> <417A6347.8090207@geminix.org> In-Reply-To: <417A6347.8090207@geminix.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Received: from gemini by geminix.org with asmtp (TLSv1:AES256-SHA:256) (Exim 3.36 #1) id 1CLNI3-0001LN-00; Sat, 23 Oct 2004 16:54:43 +0200 Subject: Re: panic caused by EVFILT_SIGNAL detaching in rfork()ed thread X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Oct 2004 14:54:44 -0000 Uwe Doering wrote: > Igor Sysoev wrote: > >> Here is more correct patch to fix the panic in 4.x reported in >> http://freebsd.rambler.ru/bsdmail/freebsd-hackers_2004/msg02732.html >> >> ------------------------- >> --- src/sys/kern/kern_event.c Sun Oct 10 12:17:55 2004 >> +++ src/sys/kern/kern_event.c Sun Oct 10 12:19:29 2004 >> @@ -794,7 +794,8 @@ >> while (kn != NULL) { >> kn0 = SLIST_NEXT(kn, kn_link); >> if (kq == kn->kn_kq) { >> - kn->kn_fop->f_detach(kn); >> + if (!(kn->kn_status & KN_DETACHED)) >> + kn->kn_fop->f_detach(kn); >> /* XXX non-fd release of kn->kn_ptr */ >> knote_free(kn); >> *knp = kn0; >> ------------------------- > > > Your patch appears to be an excerpt from the fix to RELENG_5. May I > suggest a different approach for RELENG_4? My reasoning is that the > implementation of kevents differs between RELENG_4 and RELENG_5. > > In RELENG_5 the flag KN_DETACHED is used in a more general way. It gets > set by knlist_add() and cleared by knlist_remove(), in sync with list > insertion and removal. > [...] Slight correction: The logic is of course the other way round. That is, the text is supposed to read: It gets cleared by knlist_add() and set by knlist_remove() ... Sorry about that. :-) Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net