How can I figure out the program that caused core dump? How can I figure out the program that caused core dump? unix unix

How can I figure out the program that caused core dump?


Run the Console utility, found in /Applications/Utilities. Look under DIAGNOSTIC AND USAGE INFORMATION for User Diagnostic Reports and System Diagnostic Reports. There should be an entry for each recent crash, with the name of the program, date, time, and host name. You can click on each of these for additional information.

You can also just access the diagnostic reports directly in the file system. User Diagnostic Reports are in ~/Library/Logs/DiagnosticReports/ and System Diagnostic Reports are in /Library/Logs/DiagnosticReports/.


If the system have a gdb installed, you can use gdb -c .. command:

gdb -c core.35049

You will get the output like follow:

GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9Copyright (C) 2015 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.  Type "show copying"and "show warranty" for details.This GDB was configured as "x86_64-linux-gnu".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos word" to search for commands related to "word".[New LWP 2905]Core was generated by `./a.out'.Program terminated with signal SIGSEGV, Segmentation fault.

By reading that, you will see the core was generated by a.out program.

UPDATE

Using file, you can also get similar information:

$ file corecore: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from './a.out'


I just needed to do this on OS X 10.13 and using the image list command in lldb worked for me.

lldb -c /cores/core.45943(lldb) target create "/cores/core.45943"Core file '/cores/core.45943' (i386) was loaded(lldb) image list