Linux-crash by infinite recursion

Stefan Knabe (stefan.knabe@planet-interkom.de)
Sat, 22 May 1999 18:42:00 +0200


A simple infinite recursion kills Linux :
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void InfRecursion (){
char c[4000];
InfRecursion ();
}

int main (){
InfRecursion ();
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I'm using Kernel 2.2.5, SuSE 6.1.
ulimit -s says : unlimited . That's the default in SuSE 6.1 !!!
I started the program from the Terminal-Emulation ktv under KDE.
After a while (of swapping), Linux was dead.

Well, one can avoid this by delimiting the stack via ulimit -s .
But it means, that Linux doesn't handle memory shortage gracefully.

In a similar case (QT-example dragdrop) the X-Server crashed and it wasn't
possible anymore to shutdown Linux.

Best wishes,
Stefan Knabe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/