toaruos/userspace/util/stack-overflow.c
2013-02-10 01:36:35 -08:00

20 lines
354 B
C

/* vim: tabstop=4 shiftwidth=4 noexpandtab
*
* Sample application which triggers a stack overflow
* by means of a simple infinitely recursive function.
*/
#include <stdio.h>
#include <syscall.h>
void overflow() {
int i[1024] = {0xff};
printf("Stack is at 0x%x\n", &i);
overflow();
}
int main(int argc, char ** argv) {
overflow();
return 0;
}