From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 8 16:24:38 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 949C9106568F for ; Tue, 8 Sep 2009 16:24:38 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outR.internet-mail-service.net (outr.internet-mail-service.net [216.240.47.241]) by mx1.freebsd.org (Postfix) with ESMTP id 54DDB8FC1B for ; Tue, 8 Sep 2009 16:24:38 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 68924B3F80; Tue, 8 Sep 2009 09:24:38 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 8CF042D6010; Tue, 8 Sep 2009 09:24:37 -0700 (PDT) Message-ID: <4AA68544.8050102@elischer.org> Date: Tue, 08 Sep 2009 09:24:36 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Cheng Renquan References: <4AA4E7A7.60503@gmail.com> <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com> In-Reply-To: <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Ivan Radovanovic Subject: Re: Kernel panic caused by fork X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2009 16:24:38 -0000 Cheng Renquan wrote: > On Mon, Sep 7, 2009 at 6:59 PM, Ivan Radovanovic wrote: >> I was testing FreeBSD's behavior when running many threads at the same time >> (and I find it performs excellent) when I wanted to test how system will >> behave towards program that spawns itself too many times. I wrote a very >> simple program >> >> #include >> #include >> >> int main() { >> while(1) >> fork(); >> return 0; >> } >> >> After running this program I got kernel panic with message >> "get_pv_entry: increase vm.pmap.shpgperproc" >> IMHO it is not very good idea to bring entire system down if one process >> misbehaves in this way, it is maybe much better to kill offending process >> and to send this message to system log. I am not sure whether the panic is >> actually caused by process forking forever or when the system tries to >> create new process when maxproc limit is already reached (since system is >> only printing warning message that maxproc limit is reached and it only >> panics when I try to start new process (like ps)). >> System is FreeBSD 7.2-STABLE > > It's just the "fork bomb" problem, all operating system kernels cannot > deal with it well, > > http://en.wikipedia.org/wiki/Fork_bomb It's more a tuning problem I think. The system should tune itself so that MAXPROX is hit before critical resources are exhausted I think. Having said that, there are a lot of resources that need to be watched. > > And it's really a system administration problem rather than a kernel problem, >