Crash in gpus_ReturnNotPermittedKillClient when moving to background


#1

My app uses iOS background services and performs some actions when moved to the background. I use Shinobi to display an animated graph which I refresh every second. Apps shouldn’t call any opengl functions in the background so I stop the graph redraws in applicationDidEnterBackground: - still the app crashes sometimes when moving to the background (very rarely, I cannot reproduce by myself, just see it in user’s stacktraces).

I found the following Apple page with the description of the problem:

https://developer.apple.com/library/ios/#qa/qa1766/_index.html#//apple_ref/doc/uid/DTS40012186

and the following two solutions:

http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html#//apple_ref/doc/uid/TP40008793-CH5-SW1

Now the question is - should I call glFinish() as Apple suggests or [[CCDirector sharedDirector] stopAnimation] as suggested in the StackOverflow post? As I don’t know what you do in the Shinobi code, I don’t know what the proper solution to this problem is. Thanks.


Crash in SChartGL::GLResources::glGen()
#2

Hi,

Thanks for raising this issue, I hope your development with Shinobi is going well.  We’re using our own OpenGL code to do the rendering rather than using Cocos2D, so I would recommend calling glFinish.

I hope that fixes the issue for you, let me know how things go!

Regards,

Dan


#3

Ah, sorry, haven’t checked myself and thought that CCDirector is part of iOS API. Thanks!


#4

Hello,

I’m having the same intermittent crash even though I make sure not to redraw the chart while my app is in the background. Did calling glFinish yourself seem to fix the problem?

If so, shouldn’t this call be performed by the Shibobi library itself?

Pascal


#5

No, unfortunately I’m still seeing these crashes in the logs - I also think it should be fixed inside Shinobi.


#6

Hey Guys,

I’ve raised this as a task to investigate. Someone will post back here with any progress we make!

Thanks,
Jan Akerman


#7

Any update on fixing this within Shinobi? We’re encountering the problem. I’ll try the suggestions above for handling backgrounding.

Thanks.