The power of tools (especially Instruments.app)
January 13, 2010

For a couple of weeks the Console application on my laptop has been crashing every time I started it up. This was a bit weird, and also very annoying, since I use it from time to time whilst developing, and to check that the system isn’t doing anything particularly heinous.

The stack for the crash log appeared to be in a call to the file system, so I figured that the problem was file related in some way. I tried removing the Console preferences, to no avail.

After a bit of thought, I realised that I could probably use Instruments (part of Apple’s Developer Tools suite) to work it out.

So I launched it, chose the “File Activity” template, and set it up to run Console. This is a great way to see what an application is doing with files.

Lo and behold, the last thing Instruments did was open a file in /var/log/, then repeatedly try to open some file in /.vol/.

Doing a quick ls of /var/log/ revealed a symbolic link to something that I thought that I had removed (some crappy VPN software called SecureClient that I used to rely on but don’t any more as it doesn’t work on 10.6 anyway). Further investigation revealed that the symbolic link pointed to another symbolic link, which pointed… to itself. That would do it!

All in all it took about 5 minutes to find and fix this crash once I realised that using Instruments was more sensible than just sitting around guessing what might be causing Console to crash…

« More On Doxygen From XCode Clean Code at NSConference »
Got a comment on this post? Let us know at @elegantchaoscom.