News for hackers. Stuff that matters.
Re:Explain shell by reilly3000 on Sunday February 10, 2019 @03:25AM (#19126879)
Welp, I still don't know what :(){ :|:& };: exactly does, but it sure borked my WSL. Error: 0x80070040 after forking too many processes.

I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.

Re:Explain shell by taneq on Sunday February 10, 2019 @04:27AM (#19127057)
It's a classic "fork bomb": https://en.m.wikipedia.org/wiki/Fork_bomb
Re:Explain shell by lebanon_tn on Sunday February 10, 2019 @04:27AM (#19127056)
Not quite wiki (you have to create your own notes) but you may find this utility helpful: https://github.com/sinclairtarget/um
Re:Explain shell by PurpleRamen on Sunday February 10, 2019 @03:59AM (#19126980)
You define a function named :, which calls iself and goes in the background. Then you call : at the end and start the neverending chain of :-calls till your memory bleeds.
Re:Explain shell by 1_player on Sunday February 10, 2019 @08:21AM (#19127668)
Not really: the function `:` calls itself and _pipes_ into itself.

The difference is - from what I can deduce - that if it were to only call itself, there would be up to 2 `:` processes running at a time, while the bash call stack would grow indefinitely. Using all your RAM but not an actual fork bomb.

Adding the pipe makes the number of `:` processes grow exponentially, and very quickly you reach the limit of 16384 active processes (PIDs, actually) on a Linux box.

Re:Explain shell by andai on Sunday February 10, 2019 @06:11AM (#19127324)
You have gazed upon the smileyface of doom.

Also, that does sound great.

Re:Explain shell by lolikoisuru on Sunday February 10, 2019 @12:39PM (#19128851)
It defines a function : that launches two copies of itself in the background. Then it calls that function.

    bomb() { bomb | bomb & }; bomb
Re:Explain shell by intertextuality on Sunday February 10, 2019 @07:22AM (#19127518)
Its also known as a fork bomb! I have one tattooed on my arm.
Re:Explain shell by mongol on Sunday February 10, 2019 @10:36AM (#19128144)
Interesting that WSL does not take the entire host to doom.
Re:Explain shell by reilly3000 on Sunday February 10, 2019 @12:08PM (#19128634)
Oh it did. I have 32 cores, but still managed to have so many threads running that Task Manager itself went Not Reaponding.