From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 8 16:42:05 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 0621E1065693 for ; Tue, 8 Sep 2009 16:42:05 +0000 (UTC) (envelope-from rivanr@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id 8937F8FC19 for ; Tue, 8 Sep 2009 16:42:04 +0000 (UTC) Received: by fxm6 with SMTP id 6so2654763fxm.43 for ; Tue, 08 Sep 2009 09:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=KAAXQlCGfvZBk5/xQSnFbGnJGbnW2VRqjAgYP3vPNp4=; b=TXye/zWSz+ixau724D8GUpclawstnCCDQuiTGetPwFOQdjRMmRXQ8TNC+FCUMuP7Az 5ysGFOyg3tUTl4JmCGE0yBv+nNr+a7RWEAi+zn1V5gkxnFijyuzWKC6SHW29VebhK54o 8PLaL8VpHrptIvHj7iaRPkkBISc9inMRaptNE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=dWL/g8dwoc8yvUjGwVZBwAYQmPctSqPHYI8MJ1qT1cqKko/0gul1bruDtPiG7nBDum fZLkTuYJc+zU/xbMhNyExxo4EEApZxbfpVl0zeesnYpM1BzgBVzB2ktx/a5JX/WilFX5 L3lIuqJm1bvsf/OvTb0w+Du8Vva+mVQXdvs0o= Received: by 10.102.14.4 with SMTP id 4mr6747394mun.2.1252428123402; Tue, 08 Sep 2009 09:42:03 -0700 (PDT) Received: from azdaja.softwarehood.com ([95.180.33.218]) by mx.google.com with ESMTPS id i7sm208783mue.48.2009.09.08.09.42.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 09:42:02 -0700 (PDT) Message-ID: <4AA68959.6000808@gmail.com> Date: Tue, 08 Sep 2009 18:42:01 +0200 From: Ivan Radovanovic User-Agent: Thunderbird 2.0.0.22 (X11/20090708) MIME-Version: 1.0 To: Julian Elischer References: <4AA4E7A7.60503@gmail.com> <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com> <4AA68544.8050102@elischer.org> In-Reply-To: <4AA68544.8050102@elischer.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Cheng Renquan 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:42:05 -0000 Julian Elischer napisa: > 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 >> 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. After reading this nice article on wikipedia and learning about that bash one liner I wanted to check if it really works, but I didn't want to bring the system down again (and to create crash dump and so on), so I wanted to limit number of processes for single user and I did sysctl kern.maxprocperuid=1000 as root, and after that I started bash and typed :(){ :|:& };: as normal user First thing to notice - there was more than 4000 spawned bash processes (why if I set limit to 1000 per user id?), however system didn't crash and I was eventually able to recover with /bin/kill -9 -- -1234 1234 being process group id of bash process Regards, Ivan