Core dump

From vpsget wiki
Revision as of 14:40, 5 August 2014 by Vq (talk | contribs)
Jump to: navigation, search

How to switch core dump function between node and container.

File on the node:

/proc/sys/kernel/core_pattern

Original value (dump works on node):

|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e

Edit the line so the core dump is working inside a container but isn't working on the node:

echo "/var/dump/core.%e.%p.%h.%t" >> /proc/sys/kernel/core_pattern

A code for generating core dump:

#include <stdio.h>
 
int main()
{
int *null_p = NULL;
*null_p = 10; //write to null pointer memory area,Segmentation fault will happen
return 0;
}

How to run it:

# gcc seg.c -o seg
# ./seg
Segmentation fault (core dumped)