Topics: AIX, System Admin
Collecting core dumps
A core dump is the process by which the current state of a program is preserved in a file before a program is ended because of an unexpected error.
Core dumps are usually associated with programs that have encountered an unexpected, system-detected fault, such as a segmentation fault or a severe user error. An application programmer can use the core dump to diagnose and correct the problem. The core files are binary files that are specific to the AIX operating system.
To generate a core file of a running program, you can use the gencore command. Before you do so, make sure that the system is set to allow applications to generate full core files. By default this will be disabled, to avoid applications quickly filling up file systems.
Also check your umlimts, to ensure that the user is set to allow large files to be generated. And check the available space in the file system where you want to write the core file.# lsattr -E -l sys0 -a fullcore fullcore false Enable full CORE dump True # chdev -l sys0 -a fullcore=true sys0 changed
Next, generate the core file of a running program, for example of a process with ID 65274068. Note that the gencore command creates a core file without terminating the process.
# gencore 65274068 /tmp/core_65274068Once the core file has been generated, be sure to set fullcore back to false:
Now you can use the snapcore command to gather the core file, the program, and any libraries used by the program into one pax archive, which can be sent to a vendor for further analysis. Using the -d option of the snapcore command you specify where the archive will be written.# chdev -l sys0 -a fullcore=false sys0 changed # lsattr -E -l sys0 -a fullcore fullcore false Enable full CORE dump True
# file core_65274068
core_65274068: AIX core file fulldump 64-bit, user
# snapcore -d /tmp core_65274068 /path/to/the/program
Core file "core_65274068" created by "user"
pass1() in progress ....
Calculating space required .
Total space required is 4605936 kbytes ..
Checking for available space ...
Available space is 33787748 kbytes
pass1 complete.
pass2() in progress ....
Collecting fileset information .
Collecting error report of CORE_DUMP errors ..
Creating readme file ..
Creating archive file ...
Compressing archive file ....
pass2 completed.
Snapcore completed successfully. Archive created in /tmp.
Check the file:
The resulting snapcore file can then be sent to Technical Support. It can then be uncompressed and untarred (tar can work on pax images).# ls -l -rw-rw-rw- 1 root system 12183573 Mar 22 08:50 core_65274068 -rw-r--r-- 1 root system 12594032 Mar 22 08:50 snapcore_663646.pax.Z # file snapcore_663646.pax.Z snapcore_663646.pax.Z: compressed data block compressed 16 bit
If you found this useful, here's more on the same topic(s) in our blog:
- Password-less SSH Login
- Removing ODM information of a logical volume
- Resolving IBM.DRM software errors
- Creating graphs from NMON
- Logical volumes with customized owner / group / mode
Interested in learning more?




