5

I have a friend who has a Mac (Mojave) that recently ran out of space. I found that the space was being used by files in the /cores folder. I deleted them and used to the command sudo launchctl limit core 0 0 to turn off the creation of the files. But somehow the crash dump got turned back on and the HDD was full again. Now I'm curious as to what created the core dump.

How do a go about reading a core.xxx file when I don't know which program is crashing?

Can I identify the crashing application from the core dump?

1 Answer 1

2

The handling of coredumps has changed on Mojave, so you cannot use "otool -c" as you did on older macOS versions. Instead you open the Terminal and run the following command:

lldb -c /cores/core.12345

where 12345 needs to be replaced by the actual filename of your coredump file.

When lldb has started up, you'll get an (lldb) prompt, where you enter the following command:

target list

Then you should be shown which program crashed. For example like this:

(lldb) target list
Current targets:
* target #0: /usr/local/bin/emacs ( arch=x86_64-*-*, platform=host, state=stopped )

In this case the crashed program was "emacs" in the folder /usr/local/bin.

4
  • Hello,I've tried running this command but I get back target #0: <none> (platform=host). Any other suggestions? For some context, I'm getting infinite loop of core dumps, from the moment I login (unless in safe mode), until I run out of disk space
    – Dogoku
    Feb 28, 2020 at 8:49
  • Turns out had to run with sudo to see the target
    – Dogoku
    Feb 28, 2020 at 9:32
  • 1
    You can script it if you have a bunch of core files: Put target list and exit on two lines in a text file named list_targets.lldb, and in bash, run for core in /cores/core.*; do echo "$core"; lldb -c "$core" -s list_targets.lldb; done and it'll describe 'em all. (In sudo bash, or do sudo lldb in the command.) May take a while for large files - VS Code was dumping 60 GB core files on my iMac a while back... Apr 3, 2023 at 4:25
  • Thanks Andrew! I gussied up the output with # for C in /cores/*; do stat -f '%Su:%Sg%t%SB%t%z%t%N%t' -n "$C"; echo 'target list' | lldb -c "$C" | sed -n $'s/^\* target #0: //; s/ ( /\t( /p'; done and had to manually kill an lldb that was overheating on a 552 GB dump of ¿Google Chrome?
    – Devon
    Feb 11 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .