Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Now if you really want to screw over your machine, the classic bash fork bomb is `:(){ :|:& };:`

Actually, you're wrong. At least on a mac (IIRC) it caps the process number so fork bombs just fill the console with errors. I'm sure you can get around it but that kind of defeats its simplicity.

EDIT: I mean, don't get me wrong, it still really bogs your computer down, but you can still kill the parent bash process in a few seconds.



Crashed my machine running linux Mint. I couldn't Google it, so I had to try it. I don't know what I expected.

Can someone explain how it works?



Be careful running commands that you don't understand! I've been bitten by that before...


I don't know about linux (and I really should in this case as it's my 'field'), but at least on mac, you can restrict the number of child processes a process can spawn with `ulimit -u`:

    zooey:~ duane$ ulimit -u
    709


Depends on how much RAM you have. If your machine swaps everything out to disk before it hits the process limit, then you're pretty screwed anyway.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: