How to generate core dump files

Description

Core dump files provide a snapshot of a system’s memory and process information, and are therefore useful when generated before a process crashes or otherwise exits abnormally. They are a useful aid in identifying bugs or other problems that led to a process crash.

In order to generate core dump files on your system, use the following instructions.

Linux and Mac OS X

1. When enabled, core dump files in Linux and Mac OS X are generated automatically before a process crashes. You can check whether core dump files are enabled with the following command:

ulimit -c

By default core dump files are disabled, in which case this command will return 0. To enable core dump files, use the following command:

ulimit -c unlimited

The unlimited argument refers to the core dump file size. By effectively removing a file size limit, we prevent the file from being truncated and from losing out on any useful information.

2. (Linux only step) Locate and open the following files in a text editor:

  • /etc/init.d/asperacentral
  • /etc/init.d/asperahttpd
  • /etc/init.d/asperanoded
  • /etc/init.d/asperawatchd

Find the DAEMON_COREFILE_LIMIT setting. If it is set to a limited value like 5000:

DAEMON_COREFILE_LIMIT=5000

Replace it with the following line:

DAEMON_COREFILE_LIMIT=unlimited

3. To test that your core dump files can be generated, send an abort signal to an Aspera process such as asperanoded. You can do so by looking up the process ID of asperanoded and then sending a kill signal, such as with the following commands:

pgrep asperanoded
kill -SIGQUIT process_ID

On Linux, the core dump file is generally found in the location defined by the core_pattern file, which can be viewed with the following command:

cat /proc/sys/kernel/core_pattern

If the file pipes output to another program (if there is a asperanoded in front), or if the core dump files are being saved to the directory of the process (which may not be writeable), you can change the location. For example, with the following command you can save core dump files to the tmp directory, with files named core_processName_processID:

sysctl -w kernel.core_pattern=/tmp/core_%e_%p

On Mac OS X, the core dump file is located at the following location, where X is the process ID of the process that crashed:

  • /cores/core.X

Windows

On Windows you will have to modify registry values in order to enable crash dump files. To do this use the following instructions.

1. Go to Start > Run, type regedit and click OK.

2. Expand the folders on the left to navigate to the following path:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting

3. Locate the LocalDumps key in the path. If it doesn’t exist, go to Edit > New > Key and name it LocalDumps.

4. Go to Edit > New > String Value and name it DumpFolder. Right click DumpFolder, select Modify and set the value to %LOCALAPPDATA%\CrashDumps

5. Go to Edit > New > DWORD (32-bit) Value and name it DumpCount. Right click DumpCount, select Modify and set the value to 10 and the base to Decimal.

6. Go to Edit > New > DWORD (32-bit) Value and name it DumpType. Right click DumpType, select Modify and set the value to 2 and the base to Decimal.

7. Go to Edit > New > DWORD (32-bit) Value and name it CustomDumpFlags. Right click CustomDumpFlags, select Modifyand set the value to 0 and the base to Decimal.

8. Restart Windows.

About glframebuffer

just another guy.
This entry was posted in Linux. Bookmark the permalink.

Leave a comment