I've been getting segmentation fault errors on a vulkan renderer I wrote in c++ and the terminal says it has been core dumped, I want to send the core dump file through gdb to debug where the segmentation fault is happening, but I cannot find the core dump file in the project directory nor anywhere else. I noticed that in apport.logs (the apport.logs file) it appears as if the core limit is set to 0, so I suppose no core dump file is being generated. I tried changing the ulimit -c limit in the shell session where I want to generate the core dump, but it does not seem to work. I also tried setting the core dump limit to unlimited on limits.conf, it didn't work too. Please help.
1 Answer
I want to send the core dump file through gdb to debug where the segmentation fault is happening
Note that you don't need a core dump to debug -- you can debug a live process instead. Just do gdb --args /path/to/binary args.... Then use run to run the binary, and where once GDB stops due to a crash.
If you really want to get a core, you can tweak /proc/sys/kernel/core_pattern. Use cat /proc/sys/kernel/core_pattern to see where the core dumps are currently going (probably a pipe to apport).
Use echo core | sudo tee /proc/sys/kernel/core_pattern to make core appear in the current directory.