From owner-freebsd-stable@FreeBSD.ORG Thu Sep 26 07:19:49 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 44CC7766 for ; Thu, 26 Sep 2013 07:19:49 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [94.23.254.147]) by mx1.freebsd.org (Postfix) with ESMTP id 0A89A22C7 for ; Thu, 26 Sep 2013 07:19:48 +0000 (UTC) Received: from mr129166.localdomain (mr129166.cri.univ-rennes1.fr [129.20.129.166]) by smtp.lamaiziere.net (Postfix) with ESMTPA id 572D6AB34; Thu, 26 Sep 2013 09:19:47 +0200 (CEST) Received: from mr129166 (localhost [127.0.0.1]) by mr129166.localdomain (Postfix) with ESMTP id 5E4033AB; Thu, 26 Sep 2013 09:19:46 +0200 (CEST) Date: Thu, 26 Sep 2013 09:19:45 +0200 From: Patrick Lamaiziere To: Konstantin Belousov Subject: Re: Possible kqueue related issue on STABLE/RC. Message-ID: <20130926091945.44f70996@mr129166> In-Reply-To: <20130925080633.GY41229@kib.kiev.ua> References: <20130920151705.33aae120@mr129166> <20130923153708.45c3be3d@mr129166> <20130923203141.GV41229@kib.kiev.ua> <20130924094427.0f4b902a@mr129166> <20130924082909.GH41229@kib.kiev.ua> <20130924114738.60c700c9@mr129166> <20130924121434.GI41229@kib.kiev.ua> <20130924174517.GB14220@funkthat.com> <20130924212127.GQ41229@kib.kiev.ua> <20130925095805.2072f0cc@mr129166> <20130925080633.GY41229@kib.kiev.ua> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 07:19:49 -0000 Le Wed, 25 Sep 2013 11:06:33 +0300, Konstantin Belousov a écrit : Hello, > > > On Tue, Sep 24, 2013 at 10:45:17AM -0700, John-Mark Gurney wrote: > > > > I'd like to understand why you think protecting these functions > > > > w/ the _DETACHED check is correct... In kern_event.c, all > > > > calls to f_detach are followed by knote_drop which will ensure > > > > that the knote is removed and free, so no more f_event calls > > > > will be called on that knote.. > > > > > > My current belief is that what happens is a glitch in the > > > kqueue_register(). After a new knote is created and attached, the > > > kq lock is dropped and then f_event() is called. If the vnode is > > > reclaimed or possible freed meantime, f_event() seems to > > > dereference freed memory, since kn_hook points to freed vnode. > > > > > > The issue as I see it is that vnode lifecycle is detached from the > > > knote lifecycle. Might be, only the second patch, which acquires > > > a hold reference on the vnode for each knote, is really needed. > > > But before going into any conclusions, I want to see the testing > > > results. > > > > Testing looks good with your latest patch. I was able to run a > > complete poudriere bulk (870 packages). I'm running another bulk to > > see.. I've made another bulk without problem (with complete patch) > > If you have other patches to test just ask, I have not updated my > > packages because there was a change to make gvfsd to ignore some > > poudriere activity. So I guess it will be harder to see this > > problem. > Could you, please, test with the only patch > http://people.freebsd.org/~kib/misc/vnode_filter.1.patch > applied ? I wonder would it be enough. Looks good with this single patch too, one poudriere bulk is completed and I'm doing another just in case (but I think it would have already paniced, that's quite reproductible). Thanks, regards.