How to use gdb to collect a coredump information

Jump to: navigation, search


This article explains how to use gdb packcore feature to collect the necessary files for core dump analysis..

Obtain the Wildebeest Debugger (WDB)[edit]

The gdb utitlity is part of the WDB debugger. If the customer gets the AR media updates, they should be able to find gdb in the following bundle: HP-WDB-DEBUGGER.

The softyware can also be obtained WDB at: HP WDB

Install WDB[edit]

In order to install WDB once you have the depot in place you can run:

# swinstall -s </path/to/depot> WDB


# swinstall  -s /var/tmp/HP-WDB-DEBUGGER,r=C.11.31.04,a=HP-UX_B.11.31_IA_PA.tar WDB

=======  10/21/09 15:16:56 CDT  BEGIN swinstall SESSION
         (non-interactive) (jobid=delta-0016)

       * Session started for user "root@delta".

       * Beginning Selection
       * Target connection succeeded for "delta:/".
       * Source:

       * Targets:                delta:/
       * Software selections:
           + HP-WDB-DEBUGGER,r=C.11.31.04,a=HP-UX_B.11.31_IA/PA,v=HP
           + Sentinel.SENTINEL,r=C.0.91.01,a=HP-UX_B.11.31_PA,v=HP,fr=C.0.91.01,fa=HP-UX_B.11.31_PA
       * A "+" indicates an automatic selection due to dependency or
         the automatic selection of a patch or reference bundle.
       * Selection succeeded.

       * Beginning Analysis and Execution
       * Session selections have been saved in the file
       * "delta:/":  4 filesets have the selected revision already
       * "delta:/":  1 bundles have the selected revision already
       * "delta:/":  1 bundles cannot be installed because none of
         their filesets can be installed.
       * Analysis and Execution succeeded.

NOTE:    More information may be found in the agent logfile using the
         command "swjob -a log delta-0016 @ delta:/".

=======  10/21/09 15:16:59 CDT  END swinstall SESSION (non-interactive)

Use gdb to collect coredump information[edit]

Once the application binary file has failed and generated a core dump file, you can use the gdb command to create a tar archive including the core file, libraries and other information needed to perform the analysis.

The syntax is:

# /opt/langtools/bin/gdb /path/to/command /path/to/core
(gdb) packcore 
(gdb) quit


# /opt/ignite/bin/make_tape_recovery -vA -a /dev/rmt/8mn

       * Creating local directories for configuration files and archive.

=======  10/20/09 09:58:51 EDT  Started make_tape_recovery. (Tue Oct 20 09:58:51 EDT 2009)
         @(#)Ignite-UX Revision C.7.9.260
         @(#)ignite/net_recovery (opt) Revision: /branches/IUX_RA0909_WEB/ignite/src@78846 Last Modified: 2009-08-13 14:15:12 -0600 (Thu, 13 Aug 2009)
       * Checking Versions of Ignite-UX filesets
Memory fault(coredump)

# /opt/langtools/bin/gdb /opt/ignite/bin/make_tape_recovery core
(no debugging symbols found)...Core was generated by `/opt/ignite/bin/make_tape_recovery'.
Program terminated with signal 10, Bus error.
(no debugging symbols found)...(no debugging symbols found)...
#0  0xc01fd220 in _wrtchk+0xb8 () from /usr/lib/libc.2
(gdb) packcore 
The core file has been added to packcore.tar and the core file has been removed. 
(gdb) quit

Note that in this case the core file was under the present working directory. This command generates a tar file that you can submit for analysis.