OpenSource For You

Triggering a seg-fault deliberate­ly

-

You can delLberaWe­ly Lnclude an Lllegal sWaWemenW Ln a Srogram—dereIerenc­Lng a 1ULL SoLnWer, as shown Ln Whe following code (call it test.c): @include <stdio.h[ int main() { int *ptr = krii; printf ("aereferenc­ing 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

Newspapers in English

Newspapers from India