What is your deployment target?
My deployment target was iOS4.0. I changed it to iOS4.3 and the issue is resolved! (Building against iOS5 GM SDK, of course.) My app now runs in the iOS5 simulator.
I got this idea from an answer in another SO thread that said ARC is supported in iOS4.3 and above. My app doesn't use ARC, nor do any of it's dependent libraries, as far as I can tell. The answer also said something about weak reference zeroing, which seemed... perhaps relevent since a lot of people have had success in removing specific linker directives concerning weak references to libSystem.B.dylib.
It bothers me a little that I have to move up my base deployment target beyond 4.0 because that feels like I am cutting out a lot of potential users. Despite Apple's hope that everyone will always upgrade their devices, many people do not. Oh well.
EDIT
It's worth mentioning that this project was originally done under Xcode3, so there is likely just some bizarre cruft in the project itself that is both unneeded and causing this problem. But I'll be damned if I can find it!
EDIT 2
Well, well, well... upon further inspection... I found 2 errant references to libSystem.B.dylib in my project.pbxproj file that were not visible through Xcode's build settings, but that I had to remove by hand with a text editor!
Once doing this, I reset the base deployment version to 4.0, built for the iOS5 simulator, and the app ran without issue.
Amazing.
The lesson: Never underestimate the chances for there to be garbage in your project file.
EDIT 3
Removing the 3 occurrences of these lines in the project.pbxproj
file inside the Xcode project package (right click and show package contents).
Best Answer
Nothing I tried would fix this (tried both compilers, both debuggers, etc.) After upgrading XCode for the iOS 5 update, no stack traces seemed to work.
However, I have found an effective work-around - creating my own exception handler (which is also useful for other reasons). First, create a function that will handle the error and output it to the console (as well as whatever else you want to do with it):
Next, add the exception handler to your app delegate:
That's it!
If this doesn't work, then there are only two possible reasons:
NSSetUncaughtExceptionHandler
call (there can be only one handler for your entire app). For example, some 3rd party libraries set their own uncaughtExceptionHandler. So, try setting it at the END of yourdidFinishLaunchingWithOptions
function (or selectively disabling 3rd party libraries). Or better yet, set a symbolic break point onNSSetUncaughtExceptionHandler
to quickly see who is calling it. What you may want to do is to modify your current one rather than adding another one.EXC_BAD_ACCESS
is not an exception; credit to @Erik B's comments, below)