There's a shell script floating around the Internet that looks like this:
:(){ :|: & };:
Basically this shell script just creates a function that calls itself, leading to infinite recursion. Apparently this is a fork bomb and it will keep going until it uses up resources and crashes your system.
My question is, wouldn't this script cause a stack overflow and cause the shell to segfault before it consumes all the system's resources? How does this work exactly?
ulimit
and/etc/security/limits.conf
. Bottom line is that the possibility of a stack overflow gets swamped by the actual process table overflow. – Chris Davies Sep 07 '16 at 13:06