Under The Microscope

Archive for July, 2008

Airfoil For Windows Beta

Airfoil for Windows IconRecently, we decided to re-code a large portion of Airfoil for Windows. Originally coded in Win32, it’s now been brought over to .NET. This will make it easier to maintain for the future, provide greater productivity on our end, and make it more versatile overall.

This update will be released officially in the next few weeks, but you can test it out right now. Just download it here, then leave a comment indicating any problems.

One Little Article

I’ll try not to post links to my posts on the Inside iPhone blog here too often, but I feel it worthwhile to link to my latest article. Entitled One Little Article, it’s a discussion on the differences between having AN App Store on the iPhone, which would be just one of several ways of getting software on the iPhone, and THE App Store, which is currently the exclusive way of getting software on the iPhone. Give One Little Article a read and post any thoughts in the comments there!

Audio Hijack Pro 2.8.2

Audio Hijack Pro IconFollowing up on yesterday’s updates to Airfoil and Nicecast, we’ve also got an update for our recording tool Audio Hijack Pro. Version 2.8.2 features Instant Hijack 2.1, to fully support 64-bit machines, as well as improvements to MegaMix mode used for recording from Skype, and an update to the LAME encoder.

If you’re interested in recording any audio, from DVDs to analog sources to web radio and beyond, visit the Audio Hijack Pro page or download Audio Hijack Pro directly.

Airfoil 3.2.1 And Nicecast 1.9.3

Airfoil for Mac Icon Nicecast IconToday, we’ve got minor updates to two of our applications, Airfoil for Mac and Nicecast. Airfoil for Mac’s update includes some minor fixes for Airfoil Speakers, as well as an update to the Instant Hijack component, now at version 2.1, to fully support 64-bit machines. You can download that directly right here. If you’ve never tried our solution for sending any audio to the AirPort Express, Apple TV, or any other computer, check out Airfoil’s page

Nicecast’s update also features Instant Hijack 2.1, along with an update to the LAME encoder used to create MP3 streams, improvements to Effects play through, and several small bug fixes. For more information about our audio broadcasting tool, visit the Nicecast page here, or download Nicecast directly.

The Clang Static Analyzer

In recent years, my patience has increased such that I’m now often content to wait for software to be out of beta before trying it. But some things are just so good that even in their early, buggy stages, putting up with their beta-ness is well worth it. That certainly is the case with the Clang Static Analyzer.

You may have heard about it at WWDC, or when it made the rounds last week. In short, Clang Static Analysis is like an extended set of compiler warnings for your code (C and Obj-C as of this writing). However, the Clang Checker has a vastly better understanding of your code than a compiler. It can detect memory leaks, double-frees, bad pointer references, and other such bugs that keep you up at night.

When run, the checker produces nice interactive HTML reports. Here’s an image of the report for Nicecast:

20080713clang1.png

We choose not to display the Dead Stores and Missing Deallocs, as they are rarely bugs (at least for our code). Some of the memory leaks are false positives as the checker is confused by some things, like objects that live for the lifetime of the application. But that memory leak listed for PMRunLoop.c was real. Clicking on “View” link gives the following:

20080713clang2.png

As you can see, this is a very nice syntax colored HTML listing of the source, with comments inserted showing how the leak occurs. In this case the bug is obvious: we commented out the call to Release and forgot to undo it later. In other cases the checker has found leaks for us in far more subtle places, such as large recursive functions with multiple exit points.

On our first run over our entire code base (nearing half a million lines), Clang found one major crashing bug in Nicecast that had been plaguing us for awhile, several other possible crashers in our various frameworks, and more memory leaks then you can shake a stick at (although most were in edge cases such as error handling).

After fixing all these problems, we went and re-ran the checker to generate new reports. With almost forty separate projects to run the checker on, we realized that automating this would probably be preferable. So I invested some time upgrading our build system such that it generates checker reports nightly, and posts them to our development wiki and nightly builds RSS feed. Now, each day, we get a report like this:

20080713clang3.png

While I am still hesitant about beta software, especially beta development tools, I very much recommend the Clang static checker to all developers. The amount of time it takes to use it is dwarfed by the time it saves in improving the quality of your code.