Support Center > Search Results > SecureKnowledge Details
How to enable User Mode core dump generation on different Operating Systems
Solution

On most Operating Systems, when a User Mode process crashes, a core dump file is not generated by default. The core dump file is necessary to understand why the process crashed.

Select the Operating System :

  • SecurePlatform OS 2.4
  • Gaia OS / SecurePlatform OS 2.6
  • RedHat Enterprise Linux OS
  • IPSO OS
  • Windows OS (pre-Vista)
  • Windows OS (post-Vista)
  • Solaris OS

 

SecurePlatform OS 2.4

Refer to

  1. To enable the generation of User Mode core dump files on-the-fly :

    1. Enter Expert mode: # expert

    2. Set the size of core dump file to 'unlimited'
      # ulimit -a
      # ulimit -c unlimited
      # ulimit -a

      Note: to disable, run 'ulimit -c 0' command

    3. Make sure the following line exists and set to 1 (one) in '/etc/sysctl.conf' file

      # Controls whether core dumps will append the PID to the core filename.
      # Useful for debugging multi-threaded applications.
      kernel.core_uses_pid = 1


    4. Verify that the proper level of the dump is set for LKCD utility
      # less -N -M /etc/sysconfig/dump

      Go to the bottom of the file - the parameters and their values should be as follows
      (if other numbers appear, then edit this file in Vi editor)

      DUMP_ACTIVE=1
      DUMPDEV=/dev/vmdump
      DUMPDIR=/var/log/dump
      DUMP_SAVE=1
      DUMP_LEVEL=8
      DUMP_FLAGS=0
      DUMP_COMPRESS=0
      PANIC_TIMEOUT=5


    5. Save the configuration for LKCD utility: # /sbin/lkcd config

    6. Make sure this directory exists
      /var/log/dump/usermode

      If not, then create it
      # mkdir -p /var/log/dump/usermode


  2. To enable the generation of User Mode core dump files permanently:

    1. Enter Expert mode: # expert

    2. Set the size of core dump file to 'unlimited'
      # echo 'ulimit -c unlimited' >> /etc/rc.local

      Another way, is to add 'ulimit -c unlimited' line to '/etc/rc.d/init.d/cpboot' script
      • after the line with '/opt/CPshrd-RXX/tmp/.CPprofile.sh'
      • and before the line with 'case $1 in'

      Note: to disable, use 'ulimit -c 0' command

    3. Make sure the following line exists and set to 1 (one) in '/etc/sysctl.conf' file

      # Controls whether core dumps will append the PID to the core filename.
      # Useful for debugging multi-threaded applications.
      kernel.core_uses_pid = 1


    4. Verify that the proper level of the dump is set for LKCD utility
      # less -N -M /etc/sysconfig/dump

      Go to the bottom of the file - the parameters and their values should be as follows
      (if other numbers appear, then edit this file in Vi editor)

      DUMP_ACTIVE=1
      DUMPDEV=/dev/vmdump
      DUMPDIR=/var/log/dump
      DUMP_SAVE=1
      DUMP_LEVEL=8
      DUMP_FLAGS=0
      DUMP_COMPRESS=0
      PANIC_TIMEOUT=5


    5. Save the configuration for LKCD utility
      # /sbin/lkcd config

    6. Make sure this directory exists
      /var/log/dump/usermode

      If not, then create it
      # mkdir -p /var/log/dump/usermode

    7. # reboot


  3. Core dump files should be located here
    /var/log/dump/usermode/ProcessName.PID.core



SecurePlatform OS 2.6 / Gaia OS

Refer to



Important Note: For Gaia OS R75.47, R76 and above, follow the sk92764 - Core Dump Manager (CDM) for User Mode core dump files in Gaia OS.

  1. To enable the generation of User Mode core dump files on-the-fly:

    1. Enter Expert mode: # expert

    2. Set the size of core dump file to 'unlimited'
      # ulimit -a
      # ulimit -c unlimited
      # ulimit -a

      Note: to disable, run 'ulimit -c 0' command

    3. Make sure the following line exists and set to 1 (one) in '/etc/sysctl.conf' file

      # Controls whether core dumps will append the PID to the core filename.
      # Useful for debugging multi-threaded applications.
      kernel.core_uses_pid = 1


    4. Make sure this directory exists
      /var/log/dump/usermode

      If not, then create it
      # mkdir -p /var/log/dump/usermode


  2. To enable the generation of User Mode core dump files permanently:

    1. Enter Expert mode: # expert

    2. Enable generation of core dump files: # um_core enable

      Notes:
      • to disable, run 'um_core disable' command
      • how the 'um_core' script works :
        • the 'um_core [enable|disable]' script creates/removes a file '/etc/sysconfig/enable_cores'
        • script called '/etc/initscript' runs 'ulimit -c unlimited' command, if '/etc/sysconfig/enable_cores' exists


    3. Make sure the following line exists and set to 1 (one) in '/etc/sysctl.conf' file

      # Controls whether core dumps will append the PID to the core filename.
      # Useful for debugging multi-threaded applications.
      kernel.core_uses_pid = 1


    4. Make sure this directory exists: /var/log/dump/usermode

      If not, then create it
      # mkdir -p /var/log/dump/usermode

    5. # reboot


  3. Core dump files should be located here
    /var/log/dump/usermode/ProcessName.PID.core



RedHat Enterprise Linux OS

Refer to sk77080 - How to use GDB to get function stack from User Mode process

  1. To enable the generation of User Mode core dump files on-the-fly :
    # ulimit -a
    # ulimit -c unlimited
    # ulimit -a

    Note: to disable, run 'ulimit -c 0' command

  2. To enable the generation of User Mode core dump files permanently :
    # echo 'ulimit -c unlimited' >> /etc/rc.local
    # reboot

    Note: to disable, use 'ulimit -c 0' command

  3. Make sure this directory exists
    /var/log/dump/usermode

    If not, then create it
    # mkdir -p /var/log/dump/usermode

  4. Core dump files should be located here
    /var/log/dump/usermode/ProcessName.PID.core



IPSO OS

Refer to the following articles:



Windows OS (pre-Vista)

Refer to the following articles:


Instructions:

Default location of Dr Watson is %SystemRoot%\system32\drwtsn32.exe

  1. Install Dr Watson as your default application debugger
    Start - Run - type "drwtsn32 -i" - Enter / OK

  2. Configure Dr Watson
    Start - Run - type "drwtsn32" - Enter / OK

  3. Check / change the following :
    • Log File Path = where to place the Log file (Drwtsn32.log)
    • Crash Dump = where to place the Dump file (user.dmp)
    • Crash Dump Type = Full
    • Options = check ALL the boxes (you can leave out Visual Notification and Sound Notification)

    Note: to disable, run Dr Watson and at the bottom un-check 'Create Crash Dump File'

  4. When the crash occurs, a Dump file will be created at the 'Crash Dump' path that was specified in Step C



Windows OS (post-Vista)

The 'Dr Watson' tool is deprecated.

Refer to the following articles :



Solaris OS

  1. Verify that Solaris is enabled for generation of core dump
    # dumpadm
                      Dump content :  kernel pages
                      Dump device :  /dev/dsk/<partition> (swap)
                      Savecore directory :  /var/crash/<hostname>
                      Savecore enabled :  yes
    


    Note: to disable, run 'dumpadm -n' command

  2. If the "Savecore enabled" is set to "no", then run: # dumpadm -y

    Note: to disable, run 'dumpadm -n' command

  3. Verify what kind of core files will be generated
    # coreadm
          global core file pattern : <path_to_pattern_file> (e.g., /var/core/core.%f.%p)
          global core file content : all
            init core file pattern : core
            init core file content : default
                 global core dumps : disabled   <=== option = global
            per-process core dumps : enabled    <=== option = process
           global setid core dumps : disabled   <=== option = global-setid 
      per-process setid core dumps : disabled   <=== option = process-setid
          global core dump logging : disabled   <=== option = log
    
    NOTE: you can see these setting by issuing
    # cat /etc/coreadm.conf

  4. If the "global core dumps" / "per-process core dumps" is set to "disabled", then run:
    # coreadm -e global
    # coreadm -e process

    NOTE: to disable, run 'coreadm -d global' command and 'coreadm -d process' command

  5. For more details, issue
    # man dumpadm
    # man coreadm

    dumpadm = to configure operating system crash dump
    coreadm = core file administration

  6. Core dump files should be located here
    (location is according to the pattern file - see Step C and man page)
    /var/crash/<machine_hostname>/unix.*
    /var/crash/<machine_hostname>/vmcore.*
Applies To:
  • Run cpstat os from expert mode to determine OS base.

Give us Feedback
Please rate this document
[1=Worst,5=Best]
Comment