From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 8 09:19:57 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 AB1E6106566B for ; Tue, 8 Sep 2009 09:19:56 +0000 (UTC) (envelope-from janm-freebsd-hackers@transactionware.com) Received: from mail.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.freebsd.org (Postfix) with SMTP id EA38B8FC16 for ; Tue, 8 Sep 2009 09:19:55 +0000 (UTC) Received: (qmail 20344 invoked from network); 8 Sep 2009 08:53:23 -0000 Received: from midgard.transactionware.com (192.168.1.55) by dm.transactionware.com with SMTP; 8 Sep 2009 08:53:23 -0000 Received: (qmail 24315 invoked by uid 907); 8 Sep 2009 08:53:13 -0000 Received: from jmmacpro.transactionware.com (HELO jmmacpro.transactionware.com) (192.168.1.33) by midgard.transactionware.com (qpsmtpd/0.82) with ESMTP; Tue, 08 Sep 2009 18:53:13 +1000 Mime-Version: 1.0 (Apple Message framework v1075.2) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Jan Mikkelsen In-Reply-To: <4AA4E7A7.60503@gmail.com> Date: Tue, 8 Sep 2009 18:53:13 +1000 Content-Transfer-Encoding: 7bit Message-Id: References: <4AA4E7A7.60503@gmail.com> To: Ivan Radovanovic X-Mailer: Apple Mail (2.1075.2) Cc: freebsd-hackers@FreeBSD.org 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 09:19:57 -0000 Hi, On 07/09/2009, at 8:59 PM, Ivan Radovanovic wrote: ... > 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)). A quick observation: This is not "one process misbehaving", it is a large number of processes misbehaving. From an administrative point of view, I think the response is "call setrlimit(RLIMIT_NPROC, ...)", otherwise the expected behaviour is for your machine to stop making forward progress. Having said that, I agree that panics are bad and it would be nice if fork() returned EAGAIN, again and again and again. Or perhaps the machine should just panic ... Regards, Jan.