Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Sep 2009 09:24:36 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Cheng Renquan <crquan@gmail.com>
Cc:        freebsd-hackers@freebsd.org, Ivan Radovanovic <rivanr@gmail.com>
Subject:   Re: Kernel panic caused by fork
Message-ID:  <4AA68544.8050102@elischer.org>
In-Reply-To: <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com>
References:  <4AA4E7A7.60503@gmail.com> <91b13c310909080322s21e0fb02o423434206e5f96f6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Cheng Renquan wrote:
> On Mon, Sep 7, 2009 at 6:59 PM, Ivan Radovanovic<rivanr@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

It's more a tuning problem I think.  The system should tune itself so 
that MAXPROX is hit before critical resources are exhausted I think.
Having said that, there are a lot of resources that need to be watched.



> 
> And it's really a system administration problem rather than a kernel problem,
> 




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