Kernel panic caused by fork
Cheng Renquan
crquan at gmail.com
Tue Sep 8 10:49:01 UTC 2009
On Mon, Sep 7, 2009 at 6:59 PM, Ivan Radovanovic<rivanr at gmail.com> wrote:
> I was testing FreeBSD's behavior when running many threads at the same time
> (and I find it performs excellent) when I wanted to test how system will
> behave towards program that spawns itself too many times. I wrote a very
> simple program
>
> #include <sys/types.h>
> #include <unistd.h>
>
> int main() {
> while(1)
> fork();
> return 0;
> }
>
> After running this program I got kernel panic with message
> "get_pv_entry: increase vm.pmap.shpgperproc"
> IMHO it is not very good idea to bring entire system down if one process
> misbehaves in this way, it is maybe much better to kill offending process
> and to send this message to system log. I am not sure whether the panic is
> actually caused by process forking forever or when the system tries to
> create new process when maxproc limit is already reached (since system is
> only printing warning message that maxproc limit is reached and it only
> panics when I try to start new process (like ps)).
> System is FreeBSD 7.2-STABLE
It's just the "fork bomb" problem, all operating system kernels cannot
deal with it well,
http://en.wikipedia.org/wiki/Fork_bomb
And it's really a system administration problem rather than a kernel problem,
--
Cheng Renquan (程任全), from Shenzhen, China
More information about the freebsd-hackers
mailing list