It kills my computer in an eyeblink :D Mem usage climbs up to the
maximum and everything get unresponsive -- even the mouse stops moving.
Thx.
It's a logic bomb writen in bash. Here's a more readable version:
function bomb ()
{
# use a pipe to invoke a new shell recursive
bomb | bomb & ;
}
Now, when you call this little devil, it will recursivly execute a new
shell running bomb, resulting in thousands of processes running. This
fires up your CPU load to 100% and fills up your memory.
Thanks!
PS.: Jeremiah! How do you do that you're the only one whose message is
"empty" when I recieve it via GMail. I always get only the quoted part
:)
On 1/22/07, Mirko <mka...@gmx.net> wrote:
>
--
Adam Visegradi
-----BEGIN GEEK CODE BLOCK-----
GCS/M a-- s+: dpu>d+ C++(++++)
UL++>+++ L+++>++++ W++ E(---) P+ N++
R !tv b+ D+ G++ e>++++ h-- r++ y++
------END GEEK CODE BLOCK------
I am not 100% sure if my this explation is completly correct, but for
all I know:
When using a pipe, the command in the left side of the pipe is executed
in a newly spawned sub-shell. By adding & to the rigth hand side, this
command get's also executed in a sub-shell. While your perl solution
just forks _one_ new process in every iteration, this bash beast forks
_two_ processes on each iteration. Consequently, both of the bomb
invocations will also spawn two sub-shells, resulting in 2, 4, 8, 16,
... running processes after the first, second, third fourh, ...
iteration.
This means, that after the 32. iteration, the perl script will have
spawned 32 processes, while the bash script will have spawned
4294967296 shells!
So even on a super-duper furture super-computer with several penta
bytes of RAM, this will fill up the memory in just some seconds.
On 1/22/07, Mirko <mka...@gmx.net> wrote:
>
> The fork method is exponential too. The fork doesn't wait the child to
> be ended. After spawning a new process, the spawner continues the
> iteration, so do its children and their children etc.
> Assuming the iterations are synchronized, after the Nth there will be
> 2^N processes running -- the two methods have the same efficiency :)
> I prefer a hammer. It has premanent effect.
Ahh, thanks for the correction! :)
I don't use perl much, so it looks as a plain linear iteration to me.
For example you may make all the users login with 10 nicelevel.
On 1/22/07, Adam Visegradi <a.vis...@gmail.com> wrote:
>
On Feb 2, 9:29 pm, "Jeremiah Bess" <jeremiah.b...@gmail.com> wrote:
> On 2/2/07, Suren Karapetyan <surenkarapet...@gmail.com> wrote:
>
>
>
> > Retested this thing a bit more....
> > Even ran it miwth the highest nicelevel (lowest priority) it doesn't
> > take even a second to Destroy "X". I even managed to ask a friend of
> > mine to run this on hist half-dedicated server....And you know what?
> > It stoped all 5 of his sites from running and all the other site on
> > the same server. It took him an hour to bring the server back to life.
> > I'm not quite sure I understand why this can harm the system when run
> > with low priority.
>
> > On 1/22/07, Adam Visegradi <a.visegr...@gmail.com> wrote:
>
> > > Can anybody explain this bash command to me?
> > > :(){ :|:&};:
>
> > > It kills my computer in an eyeblink :D Mem usage climbs up to the
> > > maximum and everything get unresponsive -- even the mouse stops moving.
>
> > > Thx.
>
> I think you just lost faith and credibility from your friend. =( Hope you
> guys can patch your friendship soon! lol. Good story though.
Hmm, no admin should run such script without being aware of possible
consequences. ;)
Good story, anyway, yes.
I'm not sure about it. I didn't used nice much. But I suspect, that
even with high-nice, some million processes are just too much to
handle.