Wednesday, August 3, 2011

Enable core dump and debugging in linux

Run below two commands at shell or add to your bashrc files. this will enable the core dump.
ulimit -c unlimited
echo core.%e.%p.%s.%t > /proc/sys/kernel/core_pattern

Now start your execution. Say if any core dump generated then use below command

gdb coredumpFile

When you run this it will gdb displays where segfault occurred. Below copied few lines from gdb output.

Program terminated with signal 11, Segmentation fault.
#0 0x080483e3 in fun ()

No comments: