#include #include #include static void simpleHandler(int sig) { printf("SIGSEGV (%d) reçu.\n", sig); exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { struct sigaction sa; sa.sa_handler = simpleHandler; sa.sa_flags = 0; sigaction(SIGSEGV, &sa, NULL); char *buffer; int i = 0; while (1) { printf("i: %d\n", i); buffer[i] = 'a'; fflush(stdout); i++; } return EXIT_SUCCESS; }