Linux Core Dumps

Note that most of the theory (particularly the low level segmentation fault details) are also valid for Windows platforms and other operating systems. The commands to configure core dumps and retrieve them are Linux specific though. I also assume that the program you are trying to debug is “FreeSWITCH”, but you can easily change the program name to the one is misbehaving in your case and you should be fine.

What is a core dump?

Sometimes problems with FreeSWITCH, Asterisk or just about any other program in Linux are hard to debug by just looking at the logs. Sometimes the process crashes and you don’t have a chance to use the CLI to look at stats. The logs may not reveal anything particularly interesting, or just some minimal information. Sometimes you need to dig deeper into the state of the program to poke around and see what is going on inside. Linux process core dumps are meant for that.

The most typical case for a core dump is when a process

This entry was posted in asterisk, freeswitch, linux. Bookmark the permalink.

2 Responses to Linux Core Dumps

  1. Moises Silva says:

    Thanks for sharing your tips Kapil!

    Indeed. I am not very fond of C++, but GDB scripting is a very nice way to debug more complex data structures.

    Have you heard of Project Archer? I have not had the time to install it, but I remember wanting something like that when I was working in a complex C++ application that used to crash all the time 😛

    http://sourceware.org/gdb/wiki/ProjectArcher

  2. Kapil says:

    Hey Moy,

    Nice article on GDB/Core !!

    Just to add we can also take the advantage of GDB script to debug any core very fast.

    For example , see GDB script from below location which can use to access the C++ STLs(List/Vector/Strings etc) to see if STLs corruption are the cause of your segmentation fault.

    http://sourceware.org/ml/gdb/2008-02/msg00064/stl-views.gdb

    Like this we can create the GDB script as per our requirements to access all of our complex data structures, memory management structures etc so while analyzing core we can quickly check what went wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *