From owner-svn-src-all@FreeBSD.ORG Fri May 15 07:43:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5452710656B8; Fri, 15 May 2009 07:43:27 +0000 (UTC) (envelope-from flo@kasimir.com) Received: from mail.solomo.de (mail.solomo.de [85.214.49.72]) by mx1.freebsd.org (Postfix) with ESMTP id 09D2B8FC0A; Fri, 15 May 2009 07:43:26 +0000 (UTC) (envelope-from flo@kasimir.com) Received: from localhost (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 543353F4EE; Fri, 15 May 2009 09:28:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at vistream.de Received: from mail.solomo.de ([127.0.0.1]) by localhost (mail.solomo.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DAtAmtZoUVF1; Fri, 15 May 2009 09:28:52 +0200 (CEST) Received: from nibbler.vistream.local (relay3.vistream.de [87.139.10.28]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id C4AC43F4D1; Fri, 15 May 2009 09:28:52 +0200 (CEST) Message-ID: <4A0D19B3.3070007@kasimir.com> Date: Fri, 15 May 2009 09:28:51 +0200 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090514 Shredder/3.0b3pre MIME-Version: 1.0 To: Ed Schouten References: <200905141054.n4EAsvp1088977@svn.freebsd.org> <20090515070239.GQ58540@hoeg.nl> In-Reply-To: <20090515070239.GQ58540@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r192094 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2009 07:43:27 -0000 On 15.05.09 09:02, Ed Schouten wrote: > Hi Kostik, > > * Konstantin Belousov wrote: >> Log: >> Do not advance req->oldidx when sysctl_old_user returning an >> error due to copyout failure or short buffer. >> >> The later breaks the usermode iterators of the sysctl results that pack >> arbitrary number of variable-sized structures. Iterator expects that >> kernel filled exactly oldlen bytes, and tries to interpret half-filled >> or garbage structure at the end of the buffer. In particular, >> kinfo_getfile(3) segfaulted. >> >> Reported and tested by: pho >> MFC after: 3 weeks > > Is it possible that this change introduces a regression? Right now > `pstat -t' gets stuck in an infinite loop. I've added the following > printf: > > > So the problem is that sysctl overwrites the len argument with 0, even > if it returns back to userspace with ENOMEM. > > I see we have two changes in sysctl. In theory it could also be related > to jhb@'s changes to sysctl locking, but I suspect it's less likely. > I'm seeing problems with vmstat -i hanging and taking 100% of one of 4 cores. A ktrace of the process shows this repeatedly 13521 vmstat RET __sysctl 0 13521 vmstat CALL __sysctl(0x7fffffffe1f0,0x2,0x800d0e10c,0x7fffffffe2e8,0,0) 13521 vmstat SCTL "hw.intrcnt" 13521 vmstat RET __sysctl -1 errno 12 Cannot allocate memory 13521 vmstat CALL __sysctl(0x7fffffffe260,0x2,0x7fffffffe1f0,0x7fffffffe258,0x40492b,0xa) 13521 vmstat SCTL "sysctl.name2oid" I did csup before jhb@'s patch. Cheers, Florian