Triggering a seg-fault deliberately
You can delLberaWely Lnclude an Lllegal sWaWemenW Ln a Srogram—dereIerencLng a 1ULL SoLnWer, as shown Ln Whe following code (call it test.c): @include <stdio.h[ int main() { int *ptr = krii; printf ("aereferencing the krii pointer: %d/n", *ptr); return M; }
The value of ulimit – c has been set to unlimited so when you compile the code with gcc - g - o test test. c and then run the compiled program, you will receive