The iPhone 5 crisis resolved

Lately I've faced a serious crisis related to behavior of Sky Blue, the first iOS app on client iPhone 5's. Luckily, the issue has already been resolved and a corresponding update is awaiting Apple's approval.

The problem

Few days after the AppStore release of Sky Blue, I've received a few bug reports. Each described the app as completely unusable due to crashing after startup. I was truly surprised considering the amount of testing that I've commited. Of course, 1-star AppStore reviews followed.

One device that I didn't test was the new iPhone 5 - I've optimized the UI for its taller screen but I had no access to the hardware itself. After exchanging emails with the users that contacted me, it became obvious that the bug is iPhone 5-exclusive.

iPhone 5

I was unable to determine anything as the crash reporting functionality of iTunes Connect proved completely worthless, stating that "too few reports have been submitted for a report to be shown". What the hell is that? Was I to wait for another dozen of 1-star reviews? I know that at least one user affected by the issue had the report sharing enabled and did sync with iTunes, so Apple screwed up something on the way.

Crash reports on iTunes Connect

My first thought was the fault of some new hardware in iPhone 5, with CPU utilizing the new ARMv7s architecture being the prime suspect. Still, that would be weird as I haven't compiled for this arch and released ARMv7-only binary which iPhone 5 is supposed to support.

As AppStore doesn't offer an option to block app sale just for iPhone 5 (thanks again Apple!), I was left with but one option: to buy an actual device. I would normally never even consider it due to completely ridiculous price taag of even the cheapest model...

The solution

One thing at which Apple did surprise me positively was the amount of time it took them to deliver the phone, ordered in Apple Online Store not long before Christmas. I got it in just 5 days. But then again, it was so expensive they could have sent it via private airplane straight to my house.

I was almost happy to see the app crash on my brand new iPhone, as I would be more than screwed if it didn't. One look at the crash log and it became obvious that it was mipmap generation at fault. So it wasn't the CPU as I suspected before but the GPU and its driver.

Still, I'm not sure if I would figure it out based only on the crash log and absent the faulty device. That's because glGenerateMipmap is asynchronous on iOS and therefore crash logs don't point to the instance of glGenerateMipmap that is responsible for the crash.

Like many who use OpenGL textures, I was generating mipmaps for most of loaded textures using glGenerateMipmap, but it wasn't that context that was at fault. I've also initialized mipmap levels for one special framebuffer on its creation using the same function. This is a foundation for fast bloom and DoF effects in my engine. And voila, that was the faulty piece of code that did cost me so much lately. Long story short, manually uploading the levels using glTexImage2D fixed the issue.

Once again, I consider this a fault on Apple's side. No part of their documentation state that glGenerateMipmap is asynchronous. No part of it warn you about its usage. And above all, calling glFinish after glGenerateMipmap should guarantee that after these calls, OpenGL has everything ready - that is it fact a basic principle of OpenGL as a state machine. Not here.
Even on iPad 3 on which my engine didn't crash I observe a substantial delay (at least one minute) before the mipmap generation gets effective in case of some textures. I find no such behavior on iPhone.
Is this what you call a unified platform, Apple? Are we indie developers supposed to own every device you release?

The bottom line

Anyway, the problem was solved and an update has been issued to AppStore. Unfortunately, I'm afraid it will not make it there until New Year's due to AppStore Christmas submission overload and one week during which it will be completely down.

Oh, about that. Could someone explain to me, what exactly am I waiting for upon each app submission if Apple let my app into AppStore despite it being completely unusable on their newest flagship device? And one week later they approved my 1.01 update which of course still contained the critical bug. I don't expect them to be my private bug testing team, but I expected them to do something except checking if my app icon contains porn, especially considering enormous delays.

My sincere thanks go to users Vania and Valerie for heads-up about the issue and kind words in situation when most iPhone 5 users just wanted to crucify me on the AppStore. I'll continue my effort tor people like you. Thanks!

Mentioned apps

See in AppStore
Category: Weather

Unique combination of sky simulation, forecast and Earth visualization. Smooth weather playback, ability to scroll around the world, breathtaking visuals and interface you already know.


This post has not been commented by anyone yet.

Your five cents