Subject: Re: fork() freeze the system
To: grifo <grifo3000@interfree.it>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 06/10/2004 17:13:44
In message <20040610151640.5fdf7f08.grifo3000@interfree.it>, grifo writes:
>hello,
>today a friend of mine tried the following code on my NetBSD:
>
>int main()
>{
>	while (1) 
>	   fork();
>}
>
>well, we were wondering why if launched from tty's the operating
>systems blocks the program saying: "proc table is full, please 
>increase kern.maxproc", while when run from XFree86 it freeze
>the system and need to be rebooted "phisically".
>
>> X -version
>XFree86 Version 4.4.0
>
>> uname -r
>2.0F
>
>i would be graceful to any hint!
>thankyou
>g.
>

I suspect that part of what's happening is that when you're running 
under X, a user-level process (presumably the xterm running with -C) has 
to display such kernel messages.  But that doesn't explain why the 
system would hang.

		--Steve Bellovin, http://www.research.att.com/~smb