2 ms·
A note for those encountering difficulty: most people will have to type ulimit -c unlimited to get core dumps. $ echo 'int main(void){ return *(int*)0; }'
by nitrogen 11y ago
A note for those encountering difficulty: most people will have to type ulimit -c unlimited to get core dumps.
$ echo 'int main(void){ return *(int*)0; }' > crash.c
$ gcc -Wall -Wextra -std=c1x crash.c -o crash
$ ./crash
Segmentation fault
$ ulimit -c unlimited
$ ./crash
Segmentation fault (core dumped)