r/tinycode • u/Mac-O-War • Jun 30 '11
Bash fork bomb
This will probably crash your machine. Paste the below line into a bash terminal.
:(){ :|:& };:
1
Jun 30 '11
Thinking of seeing how long my machine could stand up to that.
1
u/uzimonkey Jun 30 '11
Someone did this on an old Pentium 133MHz I'd set up for a class, it died instantly. I had to learn how to do resource limits before I could bring the machine back up again :P
1
u/riddley Jul 01 '11
Of the OSes I've tried it on, Solaris seems to hold up the best. Linux holds up much better than it used to; although I'm not sure what changed.
-2
u/authorblues Jun 30 '11
probably up to a recursion depth of 7 or 8... by the time that the function produces about 256 processes, that is likely to be more than 50% of the processes being scheduled on your system. I'd give it about 10ms
0
0
8
u/nexe mod Jun 30 '11
a classic