Subject: Re: easy ways to crash your NetBSD system
To: Phil Knaack <>
From: Michael L. VanLoon -- <>
List: current-users
Date: 04/05/1996 19:06:38
>>| >> Two easy ways to crash a NetBSD system - is it only my system or...?
>>| >> 1. main(void) { while(1) fork(); }

>>| (heh, what UNIX-alike won't?)

>>Lots of them have trouble dealing with this one, sure -- but that
>>doesn't make it right.  Per user and total system limits (with an
>>extra allowance for root on console) should enforce a situation where,
>>even if the system administrator has been too "nice" and allowed users
>>too wide a berth, the system should at the worst get really sluggish.
>>It can teeter on the brink of catatonia for all I care, as long as
>>root can log in on the console and eventually get the system back
>>under control.

>I just tried that little forker (phonetic pun intended), and this is
>exactly what happened.. the system was sluggish, the mouse in X froze
>up every few seconds, but I was able to do something about it.
>My machine is a P5/90 with 16M ram, and the max number of processes 
>allowed per user is 80 (that is enough for most people, isn't it?).
>No matter what I tried, running various fork()ing programs, I couldn't
>get the machine to crash, or come to a _complete_ halt.

Incidentally, I had a "friend", who is a Linux drone, try this exact
code snippet on my machine a little over a year ago, in the late
pre-1.0 time frame.  It did pretty much what you just described:
everything got really sluggish, response got sporadic, I finally got a
shell and did a mass kill of his process (I have a script that kills
process' by name, making that part easy).  My machine came back to
normal after that.

I'm not saying that this will always happen, but in that particular
incident it wasn't terribly traumatic.

  Michael L. VanLoon                       
        --<  Free your mind and your machine -- NetBSD free un*x  >--
    NetBSD working ports: 386+PC, Mac 68k, Amiga, Atari 68k, HP300, Sun3,
               Sun4/4c/4m, DEC MIPS, DEC Alpha, PC532, VAX...
    NetBSD ports in progress: PICA, others...