From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 8 10:49:01 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 0D04C106566B for ; Tue, 8 Sep 2009 10:49:01 +0000 (UTC) (envelope-from crquan@gmail.com) Received: from mail-vw0-f189.google.com (mail-vw0-f189.google.com [209.85.212.189]) by mx1.freebsd.org (Postfix) with ESMTP id B66378FC12 for ; Tue, 8 Sep 2009 10:49:00 +0000 (UTC) Received: by vws27 with SMTP id 27so2164930vws.3 for ; Tue, 08 Sep 2009 03:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=szK4piwxZJOSD7eJUZr4kFjPU0HWd8qRGAGMkWcrb/o=; b=VDnvYXDZm2rdgiUdRDJ9HTRPR66aF9ZZj98USIh6oyQ+LIA58gp+tNCQeggjEOIJlk L3cB7SXdZ0djPSidE4nEtmvqYlx/a4Ov0TWqeYTyDK6cwjWttiWSfkYylumolYQcQrZb loG96ZVObKetxHpOx49Uq3nM7m/tFtAOOweRY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JjMqDL05wZvRrDva1EMOuNoPykUAHYsIpYy2mXb7S7plv28g/KBAj0KOQwq6CTimP+ IyZqXWOj3FYrRJpFxyalduEbUDO82/cU0IUSgLsloBc+KuRzjAwIquSxvh9Y8NlHlVFx I1IAuxpXlt+zkd1hDCY7dXeRjcB7x5HhUYE6E= MIME-Version: 1.0 Received: by 10.220.111.80 with SMTP id r16mr14808551vcp.76.1252405323791; Tue, 08 Sep 2009 03:22:03 -0700 (PDT) In-Reply-To: <4AA4E7A7.60503@gmail.com> References: <4AA4E7A7.60503@gmail.com> Date: Tue, 8 Sep 2009 18:22:03 +0800 Message-ID: <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com> From: Cheng Renquan To: Ivan Radovanovic Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 10:49:01 -0000 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 ti= me > (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() { > =C2=A0while(1) > =C2=A0 fork(); > =C2=A0return 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 i= s > 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 And it's really a system administration problem rather than a kernel proble= m, --=20 Cheng Renquan (=E7=A8=8B=E4=BB=BB=E5=85=A8), from Shenzhen, China