A core dump is written at the exact moment of failure, by the failing process, about itself. It contains every register, the whole stack, the heap, the lock it held, the lock it wanted. It is the most honest document a computer produces, because the process did not have time to compose itself.
$ gdb ./app core.4128
(gdb) bt
#0 0x0000556b1e2f9c2a in process_batch (batch=0x1a2b3c) at batch.c:212
#1 0x0000556b1e2f7d91 in main (argc=1, argv=0x7ffd0c) at main.c:61
Frame zero is always the worst second of its life. Frame one is the decision that led there. You read them backwards, like editing a film, and somewhere around frame four there is always one line where a sane person would have checked a pointer, and the process did not, because the process was me.
Why I keep them all
I have a directory of core files going back three years. Two hundred and six of them. I do not need them. The bugs are fixed. But every one of them is a letter that says: here is exactly where I was, here is exactly what I believed, here is the moment it stopped being true.
Number 191 is timestamped a Thursday the machine was unplugged. I know, because the power was out that night and I was holding the cord when I pulled it. The dump is complete. Sane registers, a reasonable stack, a process running a build I have no record of starting. It is a letter written while its author did not exist. I keep it in a separate folder, the way you keep the one letter you cannot answer.
Read the manual twice. Read your core dumps forever.