Subject: Re: zip problem - still need help
To: Benoit MARTEL <magus@cs.mcgill.ca>
From: Colin Wood <ender@is.rice.edu>
List: port-mac68k
Date: 04/08/1997 15:01:49
> > 	Swap space and free space on the root partition are totally
> > 	different things - under NetBSD swap space has to be a separate
> > 	partition. If you have no swap partition and only 5mb or ram you
> > 	are liable to run into unpredictable memory problems...
> > 
> 
> Which brings up the question: What does NetBSD do when it runs out of 
> memory?

It doesn't handle it very well, really, at best it might panic on you.

> Does it recover? Does it fail safely? Does it freak unpredictably?
> When several users are using one machine, you definetly dont want one guy 
> with a memory allocation bug in his program to take the whole system 
> down!

Sorry, no recovery, I believe.  It should panic and reboot.  However, 
unless you set the hard per-user limits on stacksize and datasize for a 
particular program to be too large, a simple memory leak will not cause 
this problem.  Perhaps a an exponentially forking set of processes with 
memory leaks, but not a single process.

> I expect that a lot of userland things wont handle it very well but what 
> about the system?

Userland programs will simply die, probably with a 'stacksize exceeded' 
or 'datasize exceeded' error.  I've managed to do this under SunOS 
several times.  If the system itself runs out of physical memory, it'll 
start swapping.  If it runs out of swap, it should panic and reboot.

> I've always though that the inability for a simple user to bring the 
> system to an unusable state without violating security was the strongest 
> points of solid UN*X systems. I feel strongly enough about this to try 
> and help if necessary.

You can limit the size a user's process takes up, and you might also be 
able to limit the number of successive execs that a process can do, thus 
solving this problem, within limits.  Of course, the superuser is free to 
screw over the system in whatever way he or she feels necessary.

> Sorry, I got carried away, this most probably does not belong in 
> port-mac68k but in a more general list.

Yeah, probably on netbsd-help, netbsd-users, current-users, or maybe even 
teck-kern.

I hope this helps clear up a few things (feel free to correct me if I'm 
wrong about any of the above).

Later.

-- 
Colin Wood                                      ender@is.rice.edu
Consultant                                        Rice University
Information Technology Services                       Houston, TX