Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 May 2001 00:00:51 +0300
From:      Valentin Nechayev <netch@iv.nn.kiev.ua>
To:        David Xu <bsddiy@163.net>
Cc:        freebsd-questions@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG
Subject:   Re: kenel panic, vm_map_entry_create: kernel resources exhausted
Message-ID:  <20010513000051.A44618@iv.nn.kiev.ua>
In-Reply-To: <002f01c0d840$5ed38180$3601a8c0@xyf>; from bsddiy@163.net on Wed, May 09, 2001 at 12:27:33PM %2B0800
References:  <002f01c0d840$5ed38180$3601a8c0@xyf>

next in thread | previous in thread | raw e-mail | index | archive | help
 Wed, May 09, 2001 at 12:27:33, bsddiy (David Xu) wrote about "kenel panic, vm_map_entry_create: kernel resources exhausted": 

> I am using FreeBSD 4.3-STABLE,  my machine has 64 RAM.
> I can use a fork bomb to crash kernel under some conditions,
> fork bomb program is:
> 
>   #include <unistd.h>
>   int main()
>   {
>          while(1)
>         {
>              if (fork() == 0)
>                  break;
>         }
>         return 0;
> }
> 
> when kernel panic, it prints: vm_map_entry_create: kernel resources
> exhausted,
> then after some seconds, it reboots.

On my home 4.3-RC4 with maxusers=64, system does not crash.
But syslog output shows some interesting:

=== cut ===
May 12 23:52:55 iv /kernel: proc: table ible is full
May 12 23:52:55 iv /kernel: proc: table is full
May 12 23:52:55 iv last message repeated 42 times
May 12 23:52:55 iv /kernel: proble is full
May 12 23:52:55 iv /kernel: proc: table is full
May 12 23:52:55 iv last message repeated 42 times
May 12 23:52:55 iv /kernel: proc: table ible is full
May 12 23:52:55 iv /kernel: proc: table is full
May 12 23:52:55 iv last message repeated 42 times
May 12 23:52:55 iv /kernel: pros full
May 12 23:52:55 iv /kernel: proc: table is full
=== ... and so on... ===

There is one CPU in system, and possibly there is no place where such
race condition can reside in kernel. Syslogd seems to me to be more
probable place for such race (??) I saw the same race on -current where
kernel structure is totally another.

> I have found that if  I use GENERIC kernel config,  I can not trigger this
> bug,
> default maxusers value in GENERIC kernel config file is 32, this is fine,
> if I change it to 128 and recompile/install kernel,  I can use the fork bomb
> to
> crash kernel.  it seems this problem is RAM size and maxusers parameter
> related.  what max value of maxusers should I use if my RAM is 64M?

It should not crash with any reasonable maxusers value (i.e. >=1).
But system design suppose average memory usage per one user, I think
it is 2MB...4MB. Hence for 64M, maxusers=32 is normal.


/netch

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010513000051.A44618>