Howto: Generate A Core Dump For Debugging

How To:

Generate a core dump for debugging.

In case you need to analyze what a program does on Linux you can generate a Core Dump for further debugging.

Step 1

Install GNU Debugger
univention-install gdb

Step 2

When the issue happens generate core files for every process with the same name (here apache2) by typing:

root@ucs:~# echo "generate-core-file" > cmd; echo "quit" >> cmd; for pid in $(pgrep apache2); do gdb -p $pid -x cmd; done; rm cmd;

Step 3

Use the resulting files (core.$PID) for further debugging.