How to collect relevant data for application core analysis

Not sure if you knew already – there is a tool available which collects all relevant data for analyzing application cores, for example by Sun’s service and support engineers. It’s called pkgapp (not pkgadd šŸ˜‰ ) and can be directly downloaded by clicking this link.

When started (after extracting in a directory like /opt/pkgapp) using:

$ /opt/pkgapp/pkgapp -c /path_to_core_file -p /path_to_executable

it collects all libraries for that executable, several proc tool outputs, and more, and packs it into a tar file in a new directory below the current directory.

If you would like to test it, you can just create a core with the gcore command:

$ gcore PID

Where PID is the process ID of a currently running process for which you would like to create the core file. The process will not be killed; it will continue running.

A sample session looks like the following (hostname and hostid replaced by dummy entries):

$ id
uid=0(root) gid=0(root)
$ /usr/bin/sleep 30&
[1]     17825
$ gcore 17825
gcore: core.17825 dumped
$ /opt/pkgapp/pkgapp -c core.17825 /usr/bin/sleep
* ----------------------------------------------------------------------------------
* Sun Microsystems RSD pkgapp 3.0 Solaris                               [01/21/2009]
* ----------------------------------------------------------------------------------
* OS release                            [5.11]
* Platform                              [SUNW,Sun-Blade-1000]
* Checking [-c] is a core or pid        [using core /var/tmp/pkgapp/core.17825]
* Checking corefile for a valid pldd    [pldd is good with 4 elements]
* Process root                          [/usr/bin/sleep]
* Databin parameter [-s] checks         [reset to /var/tmp/pkgapp]
* Databin found                         [/var/tmp/pkgapp]
* Databin writable check                [success]
* Databin used/created is               [/var/tmp/pkgapp/pkgapp-012109-02]
* Creating temp area                    [/tmp/pkgapp.18627/]
* Checking if corefile is truncated     [core seems truncated - may not be useful]
* Checking if corefile cksum = filesz   [core cksum matches file size, may be fine]
* Process binary                        [sleep]
* Checking usage history                [not recently run]
* sleep binary bit version              [32]
* Checking path [-p] to binary name     [failed, path includes binary name]
* Resetting path [-p] parameter         [/usr/bin]
* Checking path [-p] is a directory     [success]
* Locating sleep                        [success]
* Checking located sleep is 32 bit      [success]
* Binary located                        [/usr/bin/sleep]
* Adding binary to pkgapp.pldd          [success]
* Grabbing pldd                         [success]
* Grabbing pstack                       [success]
* Grabbing pmap                         [success]
* Grabbing pcred                        [success]
* Grabbing pflags                       [success]
* Grabbing pargs                        [success]
* Not Including the core/gcore
* Javatools [-j] not set                [skipped]
* Grabbing /var/adm/messages            [success]
* Grabbing uname -a                     [success]
* Grabbing date/time                    [success]
* Grabbing showrev -p                   [success]
* Grabbing pkginfo -l                   [success]
* Grabbing /etc/release                 [success]
* Grabbing coreadm                      [success]
* Grabbing ulimit                       [success]
* Grabbing libs                         [success]
* Making lib paths app/                 [success]
* Making lib paths libs/                [success]
* Processing file 1 of 48
* Processing file 2 of 48
* Processing file 3 of 48
* Processing file 46 of 48
* Processing file 47 of 48
* Processing file 48 of 48
* Linking libraries                     [success]
* Libraries linked                      [48 ttl]
* Using hostid for naming .tar.gz       [12345678]
* Writing file                          [pkgapp-12345678-sol01-090121-094026.tar.gz]
* Done gathering files
* Writing dbxrc & files     [success]
* Writing manifest-090121-094026.log    [success]
* Writing pkgapp-args-090121-094026     [success]
* Creating final tarfile                [success]
* Compressing tarfile                   [success]
* End of runtime logging
* Saving history info                   [/var/tmp/pkgapp-history/history-090121-094026.log]
* Saving runtime log                    [/var/tmp/pkgapp-history/runtime-090121-094026.log]
* Removing [-r] temp area/files         [left alone]
* Operations Complete
Upload the following file(s) to your Cores Directory at Sun
1) File(s) located in directory /var/tmp/pkgapp/pkgapp-012109-02
[ pkgapp-12345678-sol01-090121-094026.tar.gz ]
2) File(s) located in directory /var/tmp/pkgapp/
[ core.17825 ]
Note: pkgapp has not included the core.17825 with the above pkgapp tar
Please rename the file appropriately and upload to the same location
Thank you.
Sun Software Technology Service Center (STSC)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: