On Sun, Jun 15, 2003, Beni Cherniavsky wrote about "Re: SOLVED: Slow Linux response 
during disk operations (was: Testing on various computers needed)":
> Another question: "fork bomb"s.  I think this was much worse a few
> years ago but still, when I do::
> 
>     perl -e 'for $i (1..15) { fork(); }'

No, in Unix nothing prevents you from running a fork bomb. The
administrators can limit your number of your processes with ulimit,
but typical limits still present a major drain of resourses if the user
chooses to (ab)use them all. The user can also easily lock himself out
with a fork-bomb, and be unable to remedy the situation :)

(a while ago I gave on this list, or perhaps hackers-il, an example of
a nasty but simple fork bomb, and explained how the only way to kill
it was to stifle it with a friendlier fork-bomb :)).

> the system gets completely stuck for a few seconds.  Increasing the

This may also have nothing to do with the number of processes, but
rather with the amount of memory being used exceeding the physical
memory. With ulimit you can also limit the amount of memory the user
is using.

> Perhaps it does: curiously enough, after doing this a dozen times, it
> seems that linux has "learnt" the trick: I can now fork 2^20 times
> with no effect!  Can someone enlighten me what goes on?

Perhaps all your background stuff (servers, etc.) were swapped out (making
your system stuck for a few seconds) and they never came back, so the
next run of fork loop had enough memory to run.

Remember that your number of processes *is* limited by default, so you'll
never get 2^20 processes with the above trick - just your limit.

Anyway, I don't know if that's what happened to you - it's just a guess.

-- 
Nadav Har'El                        |       Sunday, Jun 15 2003, 16 Sivan 5763
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |What's tiny, yellow and very dangerous? A
http://nadav.harel.org.il           |canary with the super-user password.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to