this post was submitted on 03 Dec 2023
688 points (95.4% liked)

linuxmemes

21278 readers
1331 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't fork-bomb your computer.

    founded 1 year ago
    MODERATORS
     
    you are viewing a single comment's thread
    view the rest of the comments
    [–] Cethin@lemmy.zip 33 points 11 months ago (2 children)

    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.

    [–] NikkiDimes@lemmy.world 21 points 11 months ago (1 children)

    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@lemmy.world 6 points 11 months ago (1 children)

    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@lemmy.world 7 points 11 months ago

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

    [–] HiddenLayer5@lemmy.ml 4 points 11 months ago* (last edited 11 months ago) (1 children)

    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@lemm.ee 8 points 11 months ago* (last edited 11 months ago) (1 children)

    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@programming.dev 4 points 11 months ago* (last edited 11 months ago)

    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