cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.34k stars 943 forks source link

Crash shortly after launch on iPad related to OpenGL and Orientation (0.8.5) #353

Closed sansumbrella closed 11 years ago

sansumbrella commented 11 years ago

When running the Basic OpenGL app on iOS with support for only Portrait orientation set in the "iPad Deployment Info," the application usually crashes shortly after launch with an EXC_BAD_ACCESS. This happens even when the device launches in Portrait orientation. The crash occurs regardless of whether I set a signal for the supported orientations.

The application usually gets through six or seven draw() calls before crashing, which suggests that the OpenGL context is changed out from under the app.

If I don't call gl::clear, the crash happens on gl::drawSolidCircle. gl::color() doesn't trigger the exception. If I remove all gl:: functions, I don't experience the crash.

Worth noting: Word Shift doesn't suffer from this issue, but the latest test apps I have compiled exhibit it consistently. I can't find the difference between them, as it is non-AA, portrait-only, with no supportedOrientations signal response configured.

Maybe @reakinator has an idea about this?

For fun, I added the following code to the draw() method: { cout << "Drawing" << endl; gl::clear( Color( 0, 0, 0 ) ); gl::color( Color::white() ); gl::drawSolidCircle( getWindowCenter(), 40.0f ); } I also disabled AA, since it destroys the iOS GPU CINDER_APP_NATIVE( TabletSanityApp, RendererGl( RendererGl::AA_NONE ) )

Stack trace (this is consistent):

sansumbrella commented 11 years ago

If I indicate support for all orientations in the build settings and set the supportedOrientations signal, the app crashes with a similar stack trace after rotation:

sansumbrella commented 11 years ago

This might not be an issue with Cinder, but instead my device suddenly getting tired. Some forums suggested doing a full restart of the iPad and I haven't seen the crash since doing that. I still wouldn't mind if someone else had a look or some insights on the problem.

See: http://stackoverflow.com/questions/14333158/sgxtexturegetimagerowbytes-exc-bad-access http://appleblogdeveloper.blogspot.com/2013/01/excbadaccess-from-sgxtexturegetimagerow.html

Maddening technology.

sansumbrella commented 11 years ago

Actually, just started experiencing the crash again after restarting the device and using it for a bit. I'm not sure what that means WRT Cinder versus the device being to blame, but I know which users would blame.

It's possible that the crash is related to the development profile and being made this evening. I'm not sure. But the crashes are consistent and occur with an extremely minimal app based on the Basic OpenGL sample.

sansumbrella commented 11 years ago

Updated XCode last night. Haven't seen the crash since then. It seems like it's a bug in the instruction set that XCode generates for the device, since it is specific to the GPU architecture and has been encountered by others with an empty Apple GLKit sample and within Maps.

Closing for now.

ghost commented 11 years ago

This sounds like something that should be reported to apple, if it can be done with the GLKit sample. Also sounds like it is a faulty upload to the device, be it the wrong symbols, instruction set or whatever, but that is really just a shot in the dark.

sansumbrella commented 11 years ago

Thanks Rich,

I will submit a bug report to Apple if it happens again now that I updated to the latest release version of XCode.