4

I have a game installed from Steam on my Mac (Crusader Kings II). The most recent patch from the developer has been having crashes and freezes on my Mac, and I'd like to help give the developer as much debugging information as possible (I'm an iOS developer myself).

One of the problems with the game involved the game completely freezing up. To assist in debugging, I used the Time Profiler from Xcode Instruments and attached it to the game. When it froze, I could see what exactly was using up processor time, and I've reported this to the developer.

However, the other problem with the game is a hard crash to the desktop. Normally, when applications (like Xcode) completely crash, OS X will give me an error report that will include useful information, like the stack trace. However, when this game crashes, I get nothing. It just completely disappears. The process is no longer in the Force Quit list, but I also get no crash report.

Is there any way, using Xcode Instruments, or any other means, to determine exactly what state the application is in in the instant just before it crashes?

My computer is a Mac Mini (late 2012 model) and I'm on OS X 10.10.1 if that matters.

  • I wish there were more users like you :) – 0942v8653 Dec 9 '14 at 22:58
  • Well, I choose to reward the game developers who give us excellent OS X games. ;) – nhgrif Dec 9 '14 at 23:01
  • I guess the console shows nothing of relevance before the crash! – Ruskes Dec 10 '14 at 0:02
  • In the situation where only them game is out to lunch it is difficult to debug, as there's no "event" to trigger logging, etc. Depending on how completely the computer's locked up, you might be able to e.g. SSH in and check out what's going on while it's locked, but that'll only work if it's just the GUI that's locked. – Ruskes Dec 10 '14 at 0:09
  • I also assume you run the AHT extended and full RAM test to check for hardware. – Ruskes Dec 10 '14 at 0:12
1

One possible way would be running:

sudo dtruss -n <app_executable>

where <app_executable> is the name of the executable file in the the app bundle in the Contents\MacOS folder inside the app.

For example, if you wanted to debug iTunes, you would first find out the executable name:

ls -alh /Applications/iTunes.app/Contents/MacOS/

drwxr-xr-x  5 root wheel 170 Mar 30 21:01 .
drwxr-xr-x 11 root wheel 374 Mar 30 21:01 ..
drwxr-xr-x  3 root wheel 102 Mar 30 21:02 iTunesHelper.app
-rwxr-xr-x  1 root wheel 29M Mar 29 02:01 iTunes <<<<<<<< this one
-rwxr-xr-x  1 root wheel 18K Mar 29 02:00 iTunesASUHelper

You can also do it by right-clicking an app in Finder and selecting Show Package Contents.

Once you figured out it is iTunes you can use the following command:

sudo dtruss -n iTunes

This will display a lot low-level info, but might contain something useful to identify the cause of a crash.

Other potentially useful built-in utilities are: iosnoop, iotop, opensnoop, execsnoop, opensnoop which are all based on dtrace which is also usable on its own.

You must log in to answer this question.

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