Date: Wed, 25 Sep 2013 09:58:05 +0200 From: Patrick Lamaiziere <patfbsd@davenulle.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-stable@freebsd.org Subject: Re: Possible kqueue related issue on STABLE/RC. Message-ID: <20130925095805.2072f0cc@mr129166> In-Reply-To: <20130924212127.GQ41229@kib.kiev.ua> References: <alpine.BSF.2.00.1309112316160.2547@olgeni.olgeni> <20130912073643.GM41229@kib.kiev.ua> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
Le Wed, 25 Sep 2013 00:21:27 +0300, Konstantin Belousov <kostikbel@gmail.com> 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. 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. Many thanks Konstantin, Regards
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130925095805.2072f0cc>