defend from -> :() { :&:; } ;:

Rob bitabyss at gmail.com
Tue Oct 23 07:06:47 PDT 2007


Mike Jeays wrote:
>>> Please do not try to execute this: :() { :&:; } ;: on your BSD machine.
>> What does it do?
> 
> It is easier to understand when you replace the ":" by a more conventional 
> subroutine name.
> 
> myproc () {
>   myproc &
>   myproc
> }
> 
> myproc
> 
> It recursively generates useless processes that clog up the machine. Mine 
> ground to a halt and froze after a few seconds.

Interesting, if not annoying ;)  Thanks for the explanation, Mike.  I edited /etc/login.conf and changed maxproc=unlimited to maxproc=200.  Then tried it.  Took a second or so to start spewing "Cannot fork: Resource temporarily unavailable".  I'd opened a 2nd session, and ps wasn't even able to give me full info on what was happening.  Luckily, is was easily interruptible and the system seemed to recover.

  -Rob



More information about the freebsd-questions mailing list