Subject: Re: easy ways to crash your NetBSD system (fork - fork recursive)
To: Ken Hornstein , Jukka Marin <>
From: Chris Phillips <>
List: current-users
Date: 04/04/1996 11:46:12
On Apr 4, 12:53am, Ken Hornstein wrote:
> Subject: Re: easy ways to crash your NetBSD system
 |>> >Two easy ways to crash a NetBSD system - is it only my system or...?

 |>> >1. main(void) { while(1) fork(); }
 |>> I think a lot of Unixes lose big on this one.

 |>I knew someone would say this.  Does this mean NetBSD shouldn't be any
 |>;-)  It doesn't feel too good that any user can bring the system down any
 |>they want. :-(

 |You could try lowering the per-user process limits to fix this.  I assume
 |that eventually you run out of VM?

The problem is that even if you limit the # of processes it will kill a machine
with system call overhead unless you make the limit so severe that it is not
reasonable for "power" X users.  In a previous position as "javelin catcher"
(SA) for a Univ.  CS Dept.  (where this happens so frequently on servers that
you have to do something) I wrote a daemon that monitored process counts (among
other things) and when a particular count was reached a message was logged and
the users processes were "cleaned" from the system.  (all processes were
"SIGSTOP'd then summarily SIGKILL'd.) This was reasonably effective under
SunOS4...  I never ported it to Sloaris as it didn't seem to be as noticeable
there, probably due to higher overhead per syscall?  Its possible just the
first part would be enough.

>-- End of excerpt from Ken Hornstein


Chris Phillips (	
	Platform Computing Corp.,	     (416) 512-9587 x310
	5001 Yonge Street, Suite 1401,       FAX   512-8976
	North York, Ontario, Canada M2N 6P6