I have a unit test (using Check) that is crashing. How do I generate a core dump so I can debug it?
$ make check
.
.
.
XXX.c:216:E:Core:test01XXX:0: (after this point) Received signal 11 (Segmentation fault)
(Line 216 is just the beginning of test01XXX, not an actual line of code)
I have tried ulimit -c unlimited
but there is no core file.
Edit: I don't think this is an issue with writing a core file in general or finding it on disk. From the same directory, I can kill -SEGV
a process and it will generate a core file:
$ ls core*
ls: cannot access core*: No such file or directory
$ cat crash.c
int main()
{
return *(int *)0;
}
$ gcc -o crash crash.c
$ ./crash
Segmentation fault (core dumped)
$ ls core*
core.121934
I think the issue is that Check traps the SIGSEGV, and I just need to configure it differently somehow.