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.
|PostgreSQL, the NoSQL Database||Jan 29, 2015|
|HPC Cluster Grant Accepting Applications!||Jan 28, 2015|
|Sharing Admin Privileges for Many Hosts Securely||Jan 28, 2015|
|Red Hat Enterprise Linux 7.1 beta available on IBM Power Platform||Jan 23, 2015|
|Designing with Linux||Jan 22, 2015|
|Wondershaper—QOS in a Pinch||Jan 21, 2015|
- PostgreSQL, the NoSQL Database
- Sharing Admin Privileges for Many Hosts Securely
- HPC Cluster Grant Accepting Applications!
- Internet of Things Blows Away CES, and it May Be Hunting for YOU Next
- Designing with Linux
- Ideal Backups with zbackup
- January 2015 Issue of Linux Journal: Security
- Non-Linux FOSS: Animation Made Easy
- Android Candy: Disney Everywhere, Even Android!
- Wondershaper—QOS in a Pinch
Editorial Advisory Panel
Thank you to our 2014 Editorial Advisors!
- Jeff Parent
- Brad Baillio
- Nick Baronian
- Steve Case
- Chadalavada Kalyana
- Caleb Cullen
- Keir Davis
- Michael Eager
- Nick Faltys
- Dennis Frey
- Philip Jacob
- Jay Kruizenga
- Steve Marquez
- Dave McAllister
- Craig Oda
- Mike Roberts
- Chris Stark
- Patrick Swartz
- David Lynch
- Alicia Gibb
- Thomas Quinlan
- Carson McDonald
- Kristen Shoemaker
- Charnell Luchich
- James Walker
- Victor Gregorio
- Hari Boukis
- Brian Conner
- David Lane