From owner-freebsd-hackers Mon Jul 10 8: 6:57 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from haldjas.folklore.ee (Haldjas.folklore.ee [193.40.6.121]) by hub.freebsd.org (Postfix) with ESMTP id C376437B76B for ; Mon, 10 Jul 2000 08:06:53 -0700 (PDT) (envelope-from narvi@haldjas.folklore.ee) Received: from localhost (narvi@localhost) by haldjas.folklore.ee (8.9.3/8.9.3) with SMTP id RAA60501; Mon, 10 Jul 2000 17:06:19 +0200 (EET) (envelope-from narvi@haldjas.folklore.ee) Date: Mon, 10 Jul 2000 17:06:19 +0200 (EET) From: Narvi To: core-ix@hushmail.com Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Some proposals to FreeBSD kernel In-Reply-To: <200007100823.BAA07998@mail3.hushmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [i think this might just as well belong in -questions] On 10 xxx -1 core-ix@hushmail.com wrote: > Hello > > I'm 18-year-old newbie UNIX programmer that currently use > FreeBSD and is really thankfull of it.I run it on DUAL PII/333. > > Some days ago my friend tell me that with simple user rights > and whit only 1 line of code he could crash my machine. I laught > but he did it :(. > > What he wrote was ' int main(void) {while(1) fork(); }' compiled it > and run it. Within a second /kernel said "proc: table is full" and > died. I tried this on some other BSD unixes and the result was > same. (BTW Minix 2.0 seem unaffected and probably other SVR4 > variants, because you can limit the number of system processes > and system still have resources to work fine(although slow)) > And you can do the same with BSD. See limits(1), csh(1), sh(1), login.conf(5) > With sysctl() I found that my system can work with up to 532 procs > simulanteously, but didnt found where this value is set in the src/ > or probably where it is computed. > See LINT - it is computed from maxusers. > So I sit down and wrote a static library that introduse a new fork() > (nfork()) and _exit() (nexit()) whose only purpose is to lower the > effect ot fast fork()s by sleeping accordingly to the number of times > fork() was called.I tend to make some more things with that piece > of code (in the attachment) and probably to add it to the kenel src > but for now it is easier to use it as a library. > I'm not really sure how usefull this is in general. > Any suggestions about tarball included are welcome. > Looking forward to hearing from you. > Thanks for reading my letter Ix > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message