Debugging a core dump
If a program crashes with a core dump then, it is easy to debug and find the last internal state of the program. When we run multiple programs or threads, then it is difficult to find which core was generated by which process. To resolve this, there are a few settings available in /proc, which will help us to add more detail in the core file name.
Support available from Kernel v2.4. Setting '1' to this file, will generate a core file with PID. For example: core.1234
Support available from Kernel v2.5. This file provides more control to form the core file name.
This is very similar to setting the core_uses_pid option.
echo "core.%p" > /proc/sys/kernel/core_pattern
By setting this value, core file will be generated with the following details: executable filename, PID of the dumped process and number of the signal causing the dump.
echo "core.%e.%p.%s" > /proc/sys/kernel/core_pattern
More useful options are explained in the proc man page.
This Tech Tip was brought to us by Bharathi in Chennai, India. Thanks, Bharathi!
Instant fame is easy at Linux Journal. Just send us your useful Tech Tips to share with the Linux Community, and we'll send you a cool t-shirt for your efforts!
Please note: Tech Tips featured in this specific section of LinuxJournal.com are kindly brought to us by readers and are not necessarily tested by LinuxJournal.com editors.
|openHAB||Apr 24, 2017|
|Omesh Tickoo and Ravi Iyer's Making Sense of Sensors (Apress)||Apr 21, 2017|
|Low Power Wireless: 6LoWPAN, IEEE802.15.4 and the Raspberry Pi||Apr 20, 2017|
|CodeLathe's Tonido Personal Cloud||Apr 19, 2017|
|Wrapping Up the Mars Lander||Apr 18, 2017|
|MultiTaction's MT Canvus-Connect||Apr 17, 2017|
- Teradici's Cloud Access Platform: "Plug & Play" Cloud for the Enterprise
- Low Power Wireless: 6LoWPAN, IEEE802.15.4 and the Raspberry Pi
- The Weather Outside Is Frightful (Or Is It?)
- Simple Server Hardening
- Understanding Firewalld in Multi-Zone Configurations
- Gordon H. Williams' Making Things Smart (Maker Media, Inc.)
- Non-Linux FOSS: Control Web-Based Music!
- Server Technology's HDOT Alt-Phase Switched POPS PDU
- IGEL Universal Desktop Converter