generate coredumps to help developer for debugging

August 23rd, 2006 mysurface Posted in Developer, gdb, ulimit | Hits: 44844 | 3 Comments »

This is what I learn from durian.

Sometimes I get an error while running certain programs, and I wish to help the developer for debugging, what should I send? config.log? screen output? What if successfully compiled the program and when I run the program it gives error? let say segmentation fault. If that is the case, Ican do something as bellow.

1. Generate CoreDumps:

To generate coredumps, I have to set the max core size to unlimited, so the correct coredump file will be generated. I do this:

ulimit -c unlimited

ulimit is a bash utils command, which use to control over the resources available to the shell and to processes started by it. ( I also not really understand what is that.) Anyway you can view all the resources control by typing

ulimit -a

2. Run the program.

Run the errornous program, and the coredump file will be generated. The file name usually looks like core.5645. And it can be very large, so it is not possible to send this file.
3. Using gdb to show which file and which line is causing these:

To run gdb with provided coredump file

gdb program-name core-filename

In gdb type


Okay, copy the screen output and send to programmer. To quit gdb, type


3 Responses to “generate coredumps to help developer for debugging”

  1. […] Usually people uses gdb to debug when obtain core dump file. A very common error that trigger core dump is segmentation fault happen, check out this example to get more idea regarding core dump, and gdb. Additional link, here is a great tutorial shows you how to debug when occur segmentation fault. […]

  2. […] Check out generate coredumps to help developer for debugging for more details of ulimit. […]

  3. My server going then he lagging and go offline, in putty stand : segmentation fault then i must restart the server, what can i do?

Leave a Reply