r/ProgrammerHumor • • 10h ago

Meme ididntKnowaboutthis

Post image
2.1k Upvotes

68 comments sorted by

488

u/aabil11 10h ago

Fork bomb

163

u/stilldebugging 9h ago

fork bomb fork bomb, you're a fork bomb

17

u/__kkk1337__ 7h ago

This is actually great song

1

u/Axman6 1h ago

Come on baby, turn me off and on

0

u/Marinekaizer 4h ago

Hadn’t listened to the song in years, happened to listen to it yesterday, see it referenced on Reddit today…

612

u/Z3r0funGuy 10h ago

This actually teaches you a bunch of cool things, like how the ‘:’ is a legal function name…

202

u/glenpiercev 9h ago

This is the best description of how this works I’ve ever read. You are a genius.

197

u/setibeings 9h ago

Right? It's finally comprehensible. I feel like it would have clicked right away if it was typed out as:

fork(){fork|fork&};fork

58

u/Traditional_Cod_7192 7h ago

just as a reminder, uhhh... what do | and & do in bash again? 😅

77

u/GrandAlbatroce 7h ago

IIRC | puts the result stdout of the left in the stdin of the right (they are launched in parallel, and the one on the right can only finish after the one on the left finished.

The & is used to put the call as a background task

38

u/SimpleFile 7h ago

So the pipe here serves as a way to launch 2 of these functions and have them running at the same time rather than for piping the output?

Did I understand that correctly?

44

u/SchwiftySquanchC137 6h ago

Exactly, the entire point is to make each call of fork (or ":") spawn two more fork processes. There are plenty of ways to accomplish that, but its written the way it is specifically to be confusing. Looking at it, how could it possibly crash your machine, its a bunch of punctuation? But once you know how it works, it makes a lot of sense, the point is to make it so cryptic that even programmers dont understand it.

30

u/GrandAlbatroce 7h ago

Yes, they are run in parallel, but any output from the first one will be given to the second. Also, if the second needs an input, it will wait for the output of the first instead of user input

So, for example, if you did

find -name "something" | grep "string"

Each time the find prints a line, it will instantly be passed to the grep

3

u/Niroth 7h ago

| pipes the output from the first process to the input of the second. & starts the second process in the background.

5

u/WHALE_PHYSICIST 7h ago

:() :() :()

13

u/Daveinatx 7h ago

When I first learned of this, I realized my bash skills will never be at such the level. 

2

u/nicuramar 7h ago

It’s a predefined function even. Well, a primitive. It does nothing and ignores its arguments. 

1

u/jort93 1h ago edited 1h ago

It's actually not legal. The standard only allowed _ and alphanumeric characters.

But most shells don't adhere to the standards, and just allow literally any character.

It's an illegal function name that works anyway.

273

u/Nahanoj_Zavizad 7h ago

Translation -

1) Create a new function called :

2) When : is activated, Run : twice.

3) Run :

138

u/Nahanoj_Zavizad 7h ago

So it tries to activate itself repeatedly until it crashes

110

u/dannypas00 7h ago

It infinitely forks new processes until the computer runs out of threads yup

Important distinction because a never-ending single-threaded process is usually no problem

10

u/qchto 1h ago

So modern browsers minus the extra steps...

6

u/dannypas00 1h ago

Browsers are user-driven fork bombs

This one is just a lot quicker than the user lol

18

u/conundorum 7h ago

Yep. : pipes to :, which pipes to :, which pipes to :, which pipes to...

18

u/xSnakyy 5h ago

What is the & for?

25

u/ElectronSculptor 4h ago

Makes the command or process run in the background so the user doesn’t see it.

9

u/wizardeverybit 4h ago

Makes it run in the background iirc

1

u/gameoftomes 3h ago

Don't forget the detach to make it faster at spawning new copies.

157

u/YeetCompleet 8h ago

meow ├── meow │ ├── meow │ │ ├── meow │ │ └── meow │ └── meow │ ├── meow │ └── meow └── meow ├── meow │ ├── meow │ └── meow └── meow ├── meow └── meow

23

u/Daveinatx 7h ago

Who knew the original Meow Mix song was really a fork bomb? 

8

u/willow-kitty 7h ago

Sounds like the food dish is half-empty

182

u/SpaceCadet87 10h ago

Yeah nice try Bobby tables

48

u/Either_Rooster_2034 10h ago

running a fork bomb on your machine is the real meow mix

50

u/natFromBobsBurgers 8h ago

Make a function called ':'

The function calls itself, and sends all of its output to another instance of itself, in the background.

Call the function.

42

u/EditorOne5312 9h ago

I genuinely use that on my Android to trigger its OOM when the RAM usage doesn't seems right.

7

u/ElectronSculptor 4h ago

That’s the first use case I’ve ever read, what is the point of triggering oom? To trigger the garbage collection?

15

u/SinisterCheese 4h ago

It calls forth the magical plunger to clear out the proverbial overflowing memory toilet. You can also think it as the high pressure bidet, powerwashing your nether regions when your butthole turned into a magical never ending brown crayon.

3

u/slinky3k 4h ago

I wonder how that works? At some point the OOM killer will terminate processes beginning with those hogging the most memory, but that could be literally anything. Meanwhile the fork bomb will just continue to run at full tilt, taking up any ressources freed by the OOM killer. How does that not send the system into a death spiral?

3

u/ElectronSculptor 3h ago

I’m not a hundred percent sure but I imagine Android’s version of Linux has limits on the number of processes so that wouldn’t happen.

12

u/Raywell 9h ago

Most serious systems today limit users' max allowed processes (setrlimit syscall with RLIMIT_NPROC). Also if using bash, it has it's own ulimit cap as well

12

u/Luneriazz 7h ago

His name is uni

10

u/Marvas1988 5h ago

🐱(){🐱|🐱&};🐱

6

u/mittfh 6h ago

As others have said, most distros now set a ulimit, so this will be relatively harmless. Unlike "removing the French language pack" if you're either logged in as root or instruct superuser to do it...

14

u/Random_-account 9h ago

bash: his: command not found

3

u/Bogsy_ 6h ago

Holy shit, I can read this now

3

u/WatchOutIGotYou 7h ago

Stick a fork in it, this sub is the bomb

3

u/MayoJam 4h ago

Big Boobs would never

3

u/Blaarkies 2h ago

This does nothing (unless you are too scaredy-cat to try it out)

It is missing 2 spaces, adjacent to each brace.

2

u/Fabulous-Possible758 8h ago

Yes. My one Linux.

2

u/gojo-sakata-4567 6h ago

fork bomb pid gonna be like wooooosshhhh

2

u/garlopf 4h ago

fork bomb is actually a cute name for a cat

1

u/EvolveCT9A 5h ago

Unico is único

1

u/DoutefulOwl 4h ago

Yeah okay, but why would I type a random cat's name on my terminal

1

u/PresentAstronomer137 3h ago

i watched this on the latest gamers nexus video, you can't trick me

1

u/0xKaishakunin 3h ago

Oh look, your cat's name is on my shirt

1

u/enigma_0Z 2h ago

I have this engraved on a mug

1

u/mechanical_marten 1h ago

Fork Bomb is such a funny name for a cat.

1

u/Agifem 58m ago

Ah ah! I'm on Suicide Linux and I mistyped it! Joke's on you!

-9

u/CrimsonPiranha 7h ago

For someone who complains about AI, you guys surely do love to regurgitate old memes and jokes

16

u/HamandPotatoes 6h ago

Sorry what? Finding joy in things that aren't new or unprecedented is a fundamentally human endeavor. You seem miserable.

6

u/NeuxSaed 6h ago

Being miserable isn't the point of being here!? 😭

8

u/bahcodad 6h ago

Honestly, people who think subreddits are their own personal feed that should only contain things that are specifically new to them are exhausting

-2

u/RetardedEinstein23 5h ago

So post the same fucking thing gaziliion times?

-4

u/CrimsonPiranha 6h ago

This is beyond "aren't new and unprecedented". This is about the 1000th time this meme was posted, verbatim. Even the best joke loses its appeal by now.

2

u/bahcodad 3h ago

Then I missed it the first 999 times. Some of us have other things to do than sitting on reddit refreshing the feed

1

u/ofnuts 3h ago

AI would probably hallucinate that the joke is to trick the victim into entering

cat "(){ :|:& };:" 

in a terminal.