Subject: How to kill NetBSD-Sparc without really trying
To: None <port-sparc@NetBSD.ORG>
From: None <MLARKIN@CSUPomona.Edu>
List: port-sparc
Date: 02/15/1996 11:47:26
I succeeded in killing my IPC last night running 1.1A. I wasn't really trying
to load down the system, but an errant process got out of line and went on
a malloc() swarm (or so it appeared). 

What happens to the system if a process tries to allocate little pieces of
memory hundreds, thousands, millions of times?

The program I was running was a Gauss-Legendre approximation of pi. Calculating
the value of pi to 1,048,576 digits (2^20) was mentioned as taking 13-15 mb
of ram for this particular run. I have 12mb physical in the IPC, but I've never had much problems running processes that need more ram (ie, swap). The swap
device is configured as a 48mb scrap partition.

About 30 seconds into the run, the system froze completely, after consistently 
getting slower and slower. All attempts to stop the runaway process failed. 

I had a systat:vmstat running in another window, and watched the pi program
eat 7mb before the vmstat was shut out completely. 

Thinking I could "ride it out" , I left the process running for a few hours,
the disk thrashing to all hell. Finally, everything stopped. No brain activity.
Clinical system death.

Any clues as to how a simple (?) usermode program could eat up all the ram and
not cause a seg viol. ? Or kernel termination at the very least. Some sort of
graceful exit. 


I have the source to the pi program if someone wants to duplicate this e
error.

-mlml