REJECTED! Can't reproduce the crash - UITabBar related
I had the Lite and paid versions of my new app were rejected for the App Store because of a crash that I never have experienced. My app is a type of calculator with four tabs.
At this time, STAT E&M LITE cannot be posted to the App Store because it is crashing on iPhone OS 2.2 and Mac OS X 10.5.5. To reproduce, launch the application then tap the Exam button at the bottom of the screen. Please refer to the attached crash logs.
All of the .crash logs from Apple are labeled "_iPod-touch.crash" I have only tested this app on my iPhone but am not aware of any difference among iPhone and iPod Touch about how tabs are handled.
Code:
EXC_BAD_ACCESS/KERN_PROTECTION_FAILURE — (This is caused by the thread trying to write to read-only memory. This is always caused by a data access.)
§ 0 STATEMLITE 0x00009ec6 0x1000 + 36550
1 STATEMLITE 0x00006aac 0x1000 + 23212
2 STATEMLITE 0x000056be 0x1000 + 18110
3 UIKit 0x30ad65ec -[UITabBarController transitionFromViewController:toViewController:] + 312
4 UIKit 0x30ad542c -[UITabBarController setSelectedIndex:] + 240
5 UIKit 0x30ad6498 -[UITabBarController setSelectedTabBarItem:] + 84
6 UIKit 0x30ad6418 -[UITabBarController tabBarItemClicked:] + 152
7 CoreFoundation 0x3027ee9c -[NSObject performSelector:withObject:withObject:] + 20
8 UIKit 0x30a501b0 -[UIApplication sendAction:to:from:forEvent:] + 128
9 UIKit 0x30a50118 -[UIApplication sendAction:toTarget:fromSender:forEvent:]
The Exception Type is EXC_BAD_ACCESS (SIGBUS)
The Exeption Code is KERN_PROTECTION_FAILURE at 0x00000000
The function that crashed is [UITabBarController transitionFromViewController:toViewController:]
This seems kind of strange to me because it seems to crash in the middle of a function that is handled by the stock UITabBarController that manages its view controllers and that I didn't fiddle with. I guess it's possible that I might have corrupted tab bar controller in some way. I was just hoping that someone might have some ideas. Since I can't reproduce it, I can't imagine having to tweak and resubmit only to hear a week later that it's still crashing.
I have already resubmitted, changing the way that I used NSUserDefaults in the AppDelegate just in case that's the issue. Also found a couple of AudioToolbox.h related interface elements in that one view controller that were left over and not being used - perhaps this could cause a problem when loading . If there's a Good Samaritan out there with an iPod Touch who is willing to a quick ad hoc installation, I would appreciate it if you would PM me with your device ID.
UPDATE - So my resubmission was reject for the same reason:
At this time, STAT E&M Coder cannot be posted to the App Store because it is crashing on iPhone OS 2.2 and Mac OS X 10.5.6.
Steps to reproduce:
(a) open app
(b) tap "Exam" tab bar button at bottom
(c) *crash*
Since the crash logs come, again from an iPod Touch, I went out and purchased one and ... no crash. So, my app is being rejected for a crash that I have never seen and can not reproduce on an iPhone or iPod Touch OS 2.2. Anyone want to buy an iPod Touch that has been used for 2 minutes?
Has anyone else run into this kind of problem? I'm going to look at the crash logs again - they sent more. However, all I can do is resubmit.
Into useful line numbers from your code. Google for 'atos' and iphone. You need a debug version of your app that was built with the EXACT same code as the distribution version sent to Apple.
Thanks for all of your suggestions. I used the symbolicatecrash command on the lastest crash dump and corresponding .dSYM file and I get a translation only up to the 4th step before the crash. I'm not sure if I'm supposed to get a further translation or not. There are like 9 .crash files that were emailed from Apple so I'll try them all.
iPhone Touch version of the simulator? I don't think I've ever seen that.
I'm pretty sure I only have one thread.
It looks to me like it's crashing right when a particular view controller is being launched via my Exam tab. I would LOVE to find out if the other three tab buttons exhibit the same behavior. Then, at least I could narrow it town to a bug in one view or view controller. I'm using IB extensively and I'm afraid that something must be corrupt about the tab bar controller. My next step is going to have to be to open another project from scratch and move things over.
You only need to translate the line '0' in the stack you posted. That's where it crashed in your code. Just figure out what class and line of code 0x00009fa6 is.
I haven't done this on this toolchain but usually when you are trying to look up symbols for an address you don't find any if that particular piece of code doesn't have any symbols (e.g., a library you don't have source for).
Well, I finally have been able to reproduce the crash. It only shows up when I install the app via the ad hoc distribution method. Obviously, there is something different about the distribution build. What I wasn't doing was actually testing the distribution build on my iPhone using the ad hoc provisioning profile.
The crash only occurs in one of the four tabs so I'm confident that I will be able to isolate the bug shortly. It's so much better than having to wait for an App Store rejection.
StatCoder, thanks for this post. I also got a submission for my app with an unknown bug. Yesterday I fixed something in the code but I´m not sure if this will solve the strange bug.
Please can you explain, how do you installed the distribution build with an ad hoc provisioning profile?
This will be easier as waiting for the next submission in some days.
If you add your own iPhone to your ad hoc list then you can run the distrubution build on that phone either directly with your iPhone hooked up or by dragging the app into iTunes like any ad hoc user. Make sure to follow the instructions about how to do the Entitlements.plist for the ad hoc configuration. I skipped over that, initially, when I was doing my submission and never went back to reading that part when I tried unsuccessfully, to do ad hoc later on.
The ultimate bug took a while to track down because it involved some sloppy use of global variables on my part. It actually ran just fine in debug but crashed on the distribution build.