Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 1995 18:22:05 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        davidg@Root.COM
Cc:        current@FreeBSD.org
Subject:   fork bombs
Message-ID:  <199505170822.SAA06582@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
When I left my nfs server turned off overnight, my nfs client forked
about 150 running crons and ran out of swap space.  This situation was
not recoverable.  ps in ddb showed the crons waiting for swap space and
the nfs server.  The vm system printed a few messages about killing
process due to lack of swap space.  When the server started, the vm
system looped printing messages about killing the same process.  After a
little while and several more ps's in ddb, the system spontaneously
rebooted.

The client has 8MB memory and 16MB swap.

I then tried a program doing `for (;;) { write(1, ".", 1); fork(); }'.
The system paniced.  I forget the details and can't reproduce the panic.

I then tried running the same program after noting the environment more
carefully.  I was non-root on the client.  There was no problem with a
process limit of 40 (swap isn't activated in this case).  I ran the
program in /tmp so nfs is probably irrelevant.

I then tried running the program as root.  The system hung.  I forget
the details.

I then tried running the program as non-root with the process limit set
to the maximum (179).  The system started swapping and never stopped.
^C and ^Z had no effect and root logins were impossible (getty didn't
even echo).  ps in ddb showed most processes runnable and a varying
number of processes were sleeping on "vmwait".  The swapper process
was always sleeping on "schedm".  New process were not being forked.
The vm system didn't print any messages about killing processes.  This
situation was easy to reproduce.

Bruce



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