pewgar_seemsimandroid,

i wanna test what happens but im Scared to do it on a vm

Oha,

ill just crash your pc after a while

lemmesay,
@lemmesay@discuss.tchncs.de avatar
redcalcium,

It was a death sentence back then, but now I bet those with a threadripper with huge RAM can tank it until it hit ulimit.

RustyNova,

Ah yes. Uni(x bomb)

uis,
@uis@lemmy.world avatar

This cat is just :3

Asudox,
@Asudox@lemmy.world avatar

:3

HiddenLayer5,
@HiddenLayer5@lemmy.ml avatar

At some point the Linux kernel will be patched to detect and terminate forking attacks, and sadly all these memes will be dead.

Zoidberg,

Just set your ulimit to a reasonable number of processes per user and you’ll be fine.

Cethin,

I doubt it. It’s the halting problem. There are perfectly legitimate uses for similar things that you can’t detect if it’ll halt or not prior to running it. Maybe they’d patch it to avoid this specific string, but you’d just have to make something that looks like it could do something but never halts.

HiddenLayer5, (edited )
@HiddenLayer5@lemmy.ml avatar

They could always do what Android does and give you a prompt to force close an app that hangs for too long, or have a default subprocess limit and an optional whitelist of programs that can have as many subprocesses as they want.

barsoap, (edited )

The thing about fork bombs that it’s not particular process which takes up all the resources, they’re all doing nothing in a minimal amount of space. You could say “ok this group of processes is using a lot of resources” and kill it but then you’re probably going to take down the whole user session as the starting point is not trivial to establish. Though I guess you could just kill all shells connected to the fork morass, won’t fix the general case but it’s a start. OTOH I don’t think kernel devs are keen on special-case solutions.

sus, (edited )

You don’t really have to kill every process, limiting spawning of new usermode processes after a limit has been reached should be enough, combine that with a warning and always reserving enouh resources for the kernel and critically important processes to remain working and the user should have all the tools needed to find what is causing the issue and kill the responsible processes

While nobody really cares enough to fix these kinds of problems for your basic home computer, I think this problem is mostly solved for cloud/virtualization providers

NikkiDimes,

That’s why I run all my terminal commands through ChatGPT to verify they aren’t some sort of fork bomb. My system is unusably slow, but it’s AI protected, futuristic, and super practical.

xaxl,

Seems inefficient, one should just integrate ChatGPT into Bash to automatically check these things.

You said ‘ls’ but did you really mean ‘ls -la’? Imma go ahead and just give you the output from ‘cat /dev/urandom’ anyway.

WhiskyTangoFoxtrot,

I said “ls” but I really meant “sl”. I just wanted to watch that steam locomotive animation.

Gruntyfish,

I prefer spoon bombs, thanks.

stjobe, (edited )

Heh, haven’t seen the bash forkbomb in close to two decades… Thanks for the trip down memory lane! :)

Bizarroland, (edited )
@Bizarroland@kbin.social avatar

You know how I know I've gotten better at using linux?

I saw the command and read it and figured out what it was although I've never been exposed to a fork bomb before in my life.

I was like okay, this is an empty function that calls itself and then pipes itself back into itself? What the hell is going on?

I will say that whoever invented this is definitely getting fucked by roko's basilisk, though. The minute they thought of this it was too late for them.

barsoap, (edited )

99.999% of that function’s effectiveness is that unix shell, being the ancient dinosaur it is, not just allows : as a function name but also uses the exact same declaration syntax for symbol and alphanumeric functions:


<span style="color:#323232;">foo(){ foo | foo&amp; }; foo
</span>

is way more obvious.

EDIT: Yeah I give up I’m not going to try to escape that &

jaybone,

It’s interesting that colon is a valid function name. Replace it with something else and it’s much more clear to understand what is going on here.

Crackhappy,
@Crackhappy@lemmy.world avatar

Eh … fork you!

AeonFelis,

Is this Elon Musk’s cat?

possiblylinux127,

On a modern system it shouldn’t be that affected if you configure it right

Bizarroland,
@Bizarroland@kbin.social avatar

Sudo fuck my system. There. Got it.

possiblylinux127,

You laugh but you can configure a hard limit on forks.

CosmicTurtle,

Probably the most elaborate Rick roll I’ve ever received.

MonkderZweite,

How did this one work again? It was something with piping in a backgrounded subshell, right?

huginn,

It creates a new process that spins up 2 new instances of itself recursively.

itsfoss.com/fork-bomb/

here’s a good explanation pulled from itsfoss.com

cupcakezealot,
@cupcakezealot@lemmy.blahaj.zone avatar

tom jones lesser known single

ook_the_librarian,
@ook_the_librarian@lemmy.world avatar

Goodness, gracious, fork bomb in bash

hexabs,

Thanks friend. One question, is it necessary to pipe to itself? Wouldnt : & in the function body work with the same results?

itslilith, (edited )
@itslilith@lemmy.blahaj.zone avatar

I may be wrong, but you could use : &;: & as well, but using the pipe reduces the amount of characters by two (or three, counting whitespace)

kablammy, (edited )

That would only add one extra process instance with each call. The pipe makes it add 2 extra processes with each call, making the number of processes grow exponentially instead of only linearly.

Edit: Also, Im not at a computer to test this, but since the child is forked in the background (due to &), the parent is free to exit at that point, so your version would probably just effectively have 1-2 processes at a time, although the last one would have a new pid each time, so it would be impossible to get the pid and then kill it before it has already replaced itself. The original has the same “feature”, but with exponentially more to catch on each recursion. Each child would be reparented by pid 1, so you could kill them by killing pid 1 i guess (although you dont want to do that… and there would be a few you wouldn’t catch because they weren’t reparented yet)

MonkderZweite,

Thanks, nice Infographic!

huginn,

Not mine, grabbed it from the link, but it’s a great explanation!

cashews_best_nut,

I just did this in zsh and had to power off my machine. :(

AnarchistsForDemocracy,
@AnarchistsForDemocracy@lemmy.world avatar

does this constitute a quine? I wrote a couple quines using bash but nothing as elegant as this

hikaru755, (edited )
@hikaru755@feddit.de avatar

Maybe I’m missing something, but I think this doesn’t print or otherwise reproduce its own source code, so it’s not a quine afaict.

AnarchistsForDemocracy,
@AnarchistsForDemocracy@lemmy.world avatar

thank you,

MacNCheezus,
@MacNCheezus@lemmy.today avatar

Correct. A quine is a program that prints its own source code. This one doesn’t print anything.

KISSmyOS,

And on a modern Linux system, there’s a limit to how many can run simultaneously, so while it will bog down your system, it won’t crash it. (I’m running it right now)

TheWoozy,

man ulimit

bighatchester,

Should I try this in a VM ?

Oha, (edited )

only thing this command does is slowly killing your pc

baatliwala,

If you actually want that cat it’s Uni

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linuxmemes@lemmy.world
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #