From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 31 21:30:12 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40F3116A400 for ; Wed, 31 Jan 2007 21:30:12 +0000 (UTC) (envelope-from zombyfork@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.freebsd.org (Postfix) with ESMTP id B04E713C48D for ; Wed, 31 Jan 2007 21:30:11 +0000 (UTC) (envelope-from zombyfork@gmail.com) Received: by nf-out-0910.google.com with SMTP id m19so671217nfc for ; Wed, 31 Jan 2007 13:30:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=kN6LNfro2h1kaO3xD6ifq0v5Mc5QhD/CQ7vWsH7qIy3JZcSJjL+Mup6/2oS5wBIoUpB1hu8Zh6/4Sck+M3Y/tDvU3NiSKapIJsCwD9huenwUIbzURiRPg7G1vKvw9jKpEaLQD9TbH3QUoD+e92drd30pzqs1e4l9nGHDu9FaVME= Received: by 10.48.216.8 with SMTP id o8mr3197117nfg.1170279005764; Wed, 31 Jan 2007 13:30:05 -0800 (PST) Received: by 10.49.63.7 with HTTP; Wed, 31 Jan 2007 13:30:05 -0800 (PST) Message-ID: <346a80220701311330t389914c7rec2c24ca6df351c9@mail.gmail.com> Date: Wed, 31 Jan 2007 14:30:05 -0700 From: "Coleman Kane" To: "Mike Meyer" In-Reply-To: <17856.54032.973691.182086@bhuda.mired.org> MIME-Version: 1.0 References: <200701311442.l0VEgQbA093491@lurza.secnetix.de> <20070131170241.230960@gmx.net> <17856.54032.973691.182086@bhuda.mired.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "Dr. Markus Waldeck" , freebsd-hackers@freebsd.org Subject: Re: top delay value X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: cokane@cokane.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 21:30:12 -0000 On 1/31/07, Mike Meyer wrote: > > In <20070131170241.230960@gmx.net>, Dr. Markus Waldeck > typed: > > > > > typing "while :; do :; done". There are a thousand ways > > > > > No. What I write above is not a "fork bomb", it's a single > > > process which is wasting CPU in a busy loop. It's exactly > > > equivalent to top(1) with zero delay, except that top > > > produces some output, while a busy loop does nothing useful > > > at all. > > > > I tested different shells and I found out that an exlicit sub shell > > is required to let the shell fork: > > > > while :; do (:); done > > That's still not a fork bomb. While it creates a process every time > through the loop, the process exits before the loop continues, so > you've still got just a few processes. Basicaly, it's still a busy > loop. > > A true fork bomb creates an ever-increasing number of processes, > typically by forking copies of itself (which led to them being called > "rabbit jobs" when I first ran into one). > > -- > Mike Meyer > http://www.mired.org/consulting.html > Independent Network/Unix/Perforce consultant, email for more information. Don't forget that a real fork bomb would fork forking forkers thereby growing the process overhead and time exponentially! e.g: perl -e 'while(1) { fork; };' -- Coleman Kane