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?