5 ms·
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 moderat
by reilly3000 8y ago
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.
- PurpleRamen 8y agoYou 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.
- 1_player 8y agoNot 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.
- lebanon_tn 8y agoNot quite wiki (you have to create your own notes) but you may find this utility helpful: https://github.com/sinclairtarget/um https://github.com/sinclairtarget/um
- taneq 8y agoIt's a classic "fork bomb": https://en.m.wikipedia.org/wiki/Fork_bomb https://en.m.wikipedia.org/wiki/Fork_bomb
- andai 8y agoYou have gazed upon the smileyface of doom. Also, that does sound great.
- intertextuality 8y agoIts also known as a fork bomb! I have one tattooed on my arm.
- mongol 8y agoInteresting that WSL does not take the entire host to doom.
- reilly3000 8y agoOh it did. I have 32 cores, but still managed to have so many threads running that Task Manager itself went Not Reaponding.
- lolikoisuru 8y agoIt defines a function : that launches two copies of itself in the background. Then it calls that function. bomb() { bomb | bomb & }; bomb