Why does the following program segfault?
int main() { main(); }
Even though it is a recursion that does not end and is therefore invalid by
Because every time it calls itself it allocates a little bit of stack space; eventually it runs out of stack space and segfaults. I'm a bit surprised it goes with a segfault, though; I would have expected (drum roll) stack overflow!