Subject: misc/11215: netbsd ending up in db mode
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mipam@ibb.net>
List: netbsd-bugs
Date: 10/13/2000 11:52:16
>Number:         11215
>Category:       misc
>Synopsis:       netbsd ending up in db mode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 13 11:52:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mipam
>Release:        NetBSD-release 3 sept
>Organization:
              just Mipam :)	
>Environment:
System: NetBSD ibb0021.ibb.uu.nl 1.4.3_ALPHA NetBSD 1.4.3_ALPHA (Mipam) #0: Sun Sep 3 18:43:18 CEST 2000 root@ibb0021.ibb.uu.nl:/usr/src/sys/arch/i386/compile/Mipam i386


>Description:
Compile this program:
#include<stdio.h>

int main()
{
 while ( fork() )
 {
  malloc(1000000);
  fork();
 }
}

call this program fun, make a little script under the name: toy
with these contents:
./fun;./fun;./fun;./fun;./fun;./fun;./fun;./toy;./toy

chmod u+x toy and run toy as just a user.
After a few seconds netbsd ends up in db mode.
Okay... i guess you all know 100000 ways to make this happen, but i
guess i seems a user can claim much memory per process and netbsd will
run outta memory and ands up in debugger mode.
Perhaps this shouldnt be so or is there a way to restrict the amount
of memory and proceses a user can fork, allocate memory?
Btw this will work with all netbsd's until 1.4.3_alpha... also
on 1.4, 1.4.1, 1.4.2 it'll work for x86 platform that is
>How-To-Repeat:
Run toy, and it's repeated... 
>Fix:
Restrict the amount of processes a user can fork ( i guess this is allrdy
done?) restrict the amount of memory a user can allocate.
>Release-Note:
>Audit-Trail:
>Unformatted: