C/C++ Programming - Solaris Core Dump Analysis

Solaris is best platforms to trace out the crash issues. They have a bunch of tools to help us instead of screaming in the office during nights :).

While analyzing the core dumps i follow few steps given below most of the time which has helped me in most of the scenarios.

  1. Observe the complete stack trace esp multi-threaded programs.
    $>pstack core|c++filt

  2. Deploy sample programs to test the possible operation that is causing issue rather than trying to debug the complete operation.

  3. Use dtrace to find out the program trace just before when the issue happens
    $dtrace -n 'pid$target:a.out::entry { ustack() }' -p PID

  4. Use DBX to figure out the variable dump, will have to use debug build

    $> dbx program core
    (dbx) threads
    (dbx) thread t@3900
    (dbx) dump

  5. Use stubs for the suspected list of functions

  6. Include log messages so as to print out the input and output data values

  7. Monitor the process resource closely during the test eg. mem, cpu usage

  8. Run the program within DBX enabled with checking of memory access, leaks, or usage
    (dbx)>check -all

  9. Use coreadm to manage core file dumps. This will help you from analyzing the previous coredumps as well if configured to dump using pid as one of the file name.

Labels: ,

About this entry