DYLD_IMAGE_SUFFIX causing havoc on Mac OS X Snow Leopard

published on October 16, 2009

Last night, I upgraded to Mac OS X Snow Leopard, so I could start using OpenCL (for a school project). After about an hour, it was ready, and all my settings were still intact. Awesome!
I immediately executed a small OpenCL benchmark application I had found on the internet and voila, it worked!

I continued, attempting to build PyOpenCL. That’s a major pain, because I can’t get Boost to build correctly. But that’s another story.

While attempting to build PyOpenCL, I decided to run the other OpenCL demos I had found. And … all of them would oddly result in crashes. Inexplicably, even the initial OpenCL benchmark application I ran, now refused to run. Even worse, the open command now seemed to fail.
What was going on?

After asking around in #macosx a bit, the very helpful user KonaB1end offered some insightful guidance. Creating another account, testing it there, it all worked. So it was my account. Then I figured I could as well try starting a new terminal with an empty ~/.bash_profile file. And that fixed it all!
So clearly, there was something in my ~/.bash_profile that was causing this. But what?

I searched for a while, and after some trial and error I was able to narrow it down to a single line:

# Show line numbers for Qt function calls in stack traces.
export DYLD_IMAGE_SUFFIX=_debug

I had added this line when I started using Qt (which is an awesome framework to build cross-platform applications in C++). It’s recommended by their documentation (and it still is, they consider it a bug of Apple, and it is — I contacted them about this). It had been working fine in Mac OS X 10.4 and 10.5, but now in 10.6 (and 10.6.1), it seems to be failing. Probably because Apple is shipping a bad debug variant of one of its own frameworks.

I’ve reported this bug to Apple: it’s online at rdar://7309435.

Comments

Ikipou's picture

Apple has failed big time on that one.

Here is a workaround while waiting for the fix: sudo mv /usr/lib/libSystem.B_debug.dylib /usr/lib/libSystem.B_debug.dylib.backup sudo cp /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B_debug.dylib.backup