Unknown and unreproducible crash causes App Store rejection - iphone

After submitting our application several times, we continue to receive the following response:
Thank you for submitting My App to the
App Store. We've reviewed your
application and determined that we
cannot post this version of your iPad
application to the App Store because
My App is crashing on iPad running
iPhone OS 3.2 and Mac OS X 10.6.2. My
App crashes upon launch.
Unfortunately, crash logs have not
been generated.
However, resigning the same build with the AdHoc entitlements and loading the build onto the device yields no such crash. After a number of attempts, the application simply does not crash as reported by the reviewer. Furthermore, the reviewer does not provide any useful logging that may have been generated by SpringBoard such as an exit status or event if it had worked properly for any other device. There are no calls to explicitly exit or quit the application in the code line and yet the application terminates on startup.
What might cause an application to terminate in such a manner?
Under what conditions is an application tested that might not be found under a development environment?
Could it be a result of a signing issue that the submission validation system is simply unable to catch?
Thanks in advance.

After fighting with this for weeks, the application has finally been approved. The key: signing corruption. Hence why the application would start (or at least appear to start by showing the splash screen) and then suddenly vanish without a crash log. It failed Springboard's preflight sighing check.
A good tool to keep in mind to check for signing issues. It tells if the application has a valid signing:
codesign -vvvv MyApp.app
When I built the application, I would cp it to a network storage device where our product manager would pull it down and submit it to Apple. If decompressed on the NAS, the code signing was valid. But if you coped the compressed application back off the NAS and validate it, it would fail.
The lesson: make use of the new XCode utility to submit applications.

A few suggestions:
Try to use the leaks tool of the static analyzer to see if there are any memory leaks or problems your not seeing.
Does your app use a web service? This happened to me one time because the day Apple was reviewing the app the web service went down. That cause a crash. If thats the case you would want to add something to catch that.
Finally, In the logs Apple sent you did they send you the dsym file? If they did you can run atos from the command line and it will convert the address to symbols. That will show you what thread and symbol it's crashing on.

Be sure you test with a variety of settings: with Wifi disabled/enabled, with 3G disabled, Airplane mode on/off, location services disabled, etc.
As a last resort, assume there is a problem in your code that executes at startup. Remove half your startup code, set your release date in the far future (just in case it gets approved), then resubmit and see if they have the same problem. If not the problem is in the half you removed... it's a binary search.

I think you have two options: try harder to reproduce the defect using the tools other people are mentioning or to catch those crashes in the field.
PLCrashReporter will trap on an uncaught exception and store all relevant information. Next time your app is run, it can send the crash report that you can then symbolificate and view a stack trace of.

Ouch! That's a tough one. I've had this kind of thing happen before, but it seemed it was reproduce-able when I switched to a different device (iPhone 3G vs 3Gs, etc.). In your case though, it sounds like you're iPad only, so that might not help. There's a difference between 3G and Wifi, I suppose, but I would be really surprised if that was causing a crash on one and not the other.
One thing you could try if you think Apple's not doing their part is to change the binary name and re-submit it under another app name/record. See if you get the same response. If you get the same reviewer, you might, but I think there's a good chance you would get a different reviewer with a new app. Just set your app release date to some time in the distant future and it will never actually show up in the app store if they approve it. If the new app comes back rejected for the same reason, you've got work to do, but if they do in fact approve it, then I would get on the phone with them and point out the discrepancy.

My approach would be to make sure that the compilation is absolutely clean both in the static analyzer (this is NOT optional, it will save you time!) and for the build itself. Then set everything as described on CocoaDev' NSZombie page. Then make sure you have an iPod running 3.2 (actual hardware, not simulator) and test, test, test. Do it with network available and not available, with the device nearly full and freshly restored, every other variation you can think of. Run it with the debugger active and as a release build disconnected. Use Leaks, Instruments and all the other tools to peek in there and get a better feel for what is happening. If you exhaust every possibility you are going to have to beg for more detail from Apple but I bet you find a problem - one of the most important things in debugging an issue like this is to try to forget everything you think you know for sure and start at the beginning.

Related

crash - where to start?

I have an app that is crashing on the device (works well in the simulator) which leads me to assume that maybe it's a memory issue...
When it crashes, there is no message whatsoever reported in the console.
It does not crash each time a certain action is taken, it crashes at different points of time always after the app has been running and in use for some time.
I know I'm supposed to ask a more specific question - but if anybody is able to tell me where to start trying to track down a crash that does not report in the console, I would really appreciate it!
I am now using the latest version of XCode (4.2)
Thanks in advance...
It very-well could be a memory issue. If that is where you want to start your diagnostics, you can use the built-in Xcode profiler. In Xcode Product->Profile will get you started.
Maybe setting the NSZombiesEnabled value to YES in Project -> Edit Active Executable -> Arguments -> Variables is also helping; this will show you memory access errors based on accessing released objects. But in that case you should at least get a SIG_ABRT or BAD_ACCESS error ...
You can also log when the app receives a memory warning in the didReceiveMemoryWarning functions of your view controllers - this is called before the system is throwing out stuff when memory gets low. That of course could lead to a crash with nothing showing.
First, relax.
Then read this Technical Note.
Now, follow these steps:
From /Users/<username>/Library/Developer/Xcode/DerivedData remove all folders.
From /Users/<username>/Library/Application Support/iPhone Simulator remove all folders.
Clean your trash.
Remove app from device.
Build and run application on device.
Follow the steps that leads toward a crash.
Now, go to XCode->Window->Organizer and select "Device Logs" your device from the DEVICES pane. Select the most recent of these which has your application's name. Wait for XCode to symbolicate the crashlog. There are two possibilities now:
Its a low memory crash.
Its a memory management related crash.
If its option one, profile your application in Instruments.
If its option two, you should see the stack frame where you application is crashing (or your module's stack). This SO question will be very helpful
If you cannot understand the output (or you think the crashlog is not symbolicating - or that its not your code that's crashing), please post the crash log's crashing thread's stack here and I'll look into it.
PS: in the first section we do the first two steps to make sure there are no left-over .app/.dSYM files which might hinder symbolication later in the process because XCode symbolicator is not that intelligent.

Is there a way to automatically include the console output with the crash log on ios

The crash log returned when your app has an error on iOS is wonderful however it would be 100 times better if it contained the console output from when your app started as part of the log. Is there a way to automatically have that information in the crash log, or have a semi-automatic system that testers could use when sending in crash logs?
I think you might want to take a look at http://apphance.com. It's exactly what you are looking for - including capability of sending problem reports from device by testers, including screenshots, you can track history of session including full console logs, you can even see crashes from out-of-memory problems which are otherwise difficult to get without physical access to the device. It's closed beta for now but soon it will be open for everyone. You can request access directly at the page.
Disclaimer: I am CTO of Polidea, company which is behind apphance and co-creator of the service.
#Medran i am not sure if this will help but if you can get the Brad Larsons videos on Advance iPhone App Development than there he says some thing about .dSYM file that will help you find the places where crash occurs. .dSYM file is made when you build your app using Xcode. See if you can find that file in your project folder its named something like this MYapp.app.dSYM

What can cause unreported crashes for an iphone app?

I have an app that I occasionally receive support emails for that say the app crashed on them and won't open up anymore. It shows 'Default.png' then exits. Even when the app is deleted and reinstalled.
-I get no crash reports or memory issues (as reported by itunes connect using reports from a significant sample size >20k downloads)
-I've confirmed it's not limited to a specific model and not caused by jailbroken devices.
-The app doesn't have external dependencies, so why would reinstalling it not fix the problem?
What kind of problems could cause the crashing to go unreported and be persistent?
If you have an uncaught exception handler, depending on what you have in there, you will not get reports written out the same way, or at all, as if you did not have a handler. This will make iTunes think there is not any crash reports at all. Uncaught exception handlers are commonly added as part of analytics frameworks, or third party notification tools.
While this could answer your question, a more reasonable explanation is that the crashing devices just need a device restart.
I think every app developer with a sizable install base has struggled with an issue like this in the past.
Are you using any sort of analytics package, such as Flurry, that helps you report crashes? We used Flurry with much greater success over Apple - Apple won't start reporting crashes to you until you have many -- and "just a few" is never enough.
Additionally, if it shows the default.png and crashes, take a hard look at your start-up code. Are you setting something in NSUserDefaults, that if, corrupted, could cause the app to crash on startup?
Admittedly it is strange that a delete-and-reinstall doesn't do the trick.
The users aren't reporting the error reports to Apple. The crashes could come from any number of sources.
You could walk a user through the process of digging crash reports directly out of iTunes during the next Sync and email them directly to you.
You could try asking a user to delete the app from the device, reboot their device, then have them install the app again after a fresh reboot.

My App works perfectly on my Droid X, reviewers complain of crashes on other devices - how to debug?

Some say it doesnt start on their HTC Hero, another says it doesnt open in their Cliq, etc. I built the entire app using my Droid X to debug. Now that the app is released, and the code is interacting with so many different types of hardware, how do I figure out what may be going wrong for these users?
In my Crash errors log I have one record of a crash, and I believe I've already fixed this. It was certainly not responsible for the crashes that users are complaining about.
Maybe you have to check manually or maybe it's a problem of multiresolution because different mobile have different resolutions. Otherwise if it is possible then you have to include crash log report in your application which send crash logs to your email id.
Or you can ask them to install crash log reporter and set your emailid to target for crash report. Try this link, first one for manually adding code to your application.
https://github.com/tomquist/Android-Error-Reporter
http://www.androidzoom.com/android_applications/tools/log-collector_tlt.html
Do you have any Logcat outputs in release mode? May be they help you out..
Alternatively, you can test it out on 3rd party mobile testing vendors.. Where in you can buy some hours and do some quick testing...

iPhone App fails to properly ??copy? database file ONLY with ad-hoc or app-store distribution and NOT in development mode

I just submitted this to Apple Support, but I'm wondering if anyone here has encountered something similar.
SUMMARY: my iphone app crashes when downloaded from the iTunes app store or from an ad-hoc distribution, but doesn't "crash" when run in debug mode on the simulator or on my iPod
DETAILS: The app contains a rather large sqlite database file (~180 meg uncompressed, 56 meg compressed). This may be relevant.
When launched, the application should copy the database (if necessary). After this, the user should be presented with a table-view containing approximately 6,000 rows. The information presented within these rows is derived from reading a table within the aforementioned database.
This all works properly when I run the application in the iPhone simulator and also when I run the application in debug mode on my iPod.
The app was approved by Apple. However, when users began to download the app through iTunes, I began receiving emails saying that the UITableView was not populated with any information. To investigate, I downloaded a copy of the app from the app store and I saw a similar result (i.e., UITableView is displayed, but the rows are empty).
I believe I am able to reproduce the problem using an ad-hoc distribution of my app.
The ad-hoc distribution behaves similarly (i.e. shows no rows in the UITableView) to the app-store download. Specifically, I have done the following multiple times (I delete and reinstall the application each time).
add my ad-hoc provisioning
certificate to iTunes
add my ad-hoc app build to iTunes
sync my iPod Touch with iTunes
start my ad-hoc app
app seems to always crash upon the first startup (i.e., the splash screen shows for a second and then I see the home screen of my iPod Touch)
second and subsequent start-ups of the ad-hoc app do not crash, but the UITableView is empty.
None of this happens when I run the app on the simulator or when I deploy in development/debug mode on the same iPod.
I have tried to examine crash logs associated with the initial crashing of the app (see step 5 above), but no crash log is created at that point in time. HOWEVER, a crash log is created when I sync iTunes with my iPod Touch, but it might as well be written in Polish.
So, it appears as though the app-store reviewers who approved my app only examined the behavior of the application using the simulator and/or in development/debug mode. It's possible that the issue is related to the large size of the database file, but this is complete speculation on my part. To the best of my understanding there should not be a limit on app-size or database size near 180 meg. This also wouldn't necessarily explain why the app works in debug/development mode.
Has anyone seen anything similar?
I think I figured this out (haven't tested it yet)...
Turns out the entire crash log isn't written in polish.
There's a part that says that the "application failed to launch in time"
I suspect that my database is too large to be copied during launch of the application.
to quote apple: ***iPhone OS uses a watchdog timer when applications are launched. If an application takes too long to complete its initial startup, the operating system terminates the application. Applications terminated for this reason will have the exception code 0x8badf00d and related information noted in the associated crash report:*
*When Xcode launches an application, the watchdog timer is disabled to compensate for additional overhead that may be incurred when Xcode attaches the debugger. As a result, your application's long startup may initially escape your attention if you are exclusively testing by running from Xcode.***