Valgrind produced a vgcore.NNNN file -- how do I debug the core using GDB? Do I need to use the original executable and supply the core, or is there some other way to do it?
Using valgrind as the root executable doesn't seem to work, and using the executable that was being run under valgrind directly in GDB with the core seems to produce bad backtraces.
This works fine for me:
gdb ./a.out vgcore.21650
and that's how you are supposed to use the vgcore.
If your program corrupted stack before crashing, then obviously you wouldn't get good stack traces from vgcore. You might want to expand your question with actual Valgrind report that led to the crash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With