{"id":3557,"date":"2014-03-28T10:36:30","date_gmt":"2014-03-28T10:36:30","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/28\/spritekit-crashes-when-entering-background-collection-of-common-programming-errors\/"},"modified":"2014-03-28T10:36:30","modified_gmt":"2014-03-28T10:36:30","slug":"spritekit-crashes-when-entering-background-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/28\/spritekit-crashes-when-entering-background-collection-of-common-programming-errors\/","title":{"rendered":"Spritekit crashes when entering background-Collection of common programming errors"},"content":{"rendered":"<p>Allright guys, I&#8217;ve been developing an app in which I have a NSMutableDictionary with an SKAction object in it. The SKAction is for playing a sound.<\/p>\n<p>This all works well, except &#8230; the app crashes upon entering background with the following stack trace:<\/p>\n<pre><code>* thread #1: tid = 0x187d7, 0x3461b932 libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient + 10, queue = 'com.apple.spritekit.renderQueue, stop reason = EXC_BAD_ACCESS (code=1, address=0x1)\nframe #0: 0x3461b932 libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient + 10\nframe #1: 0x3461c3d0 libGPUSupportMercury.dylib`gpusSubmitDataBuffers + 104\nframe #2: 0x2eafc4a4 IMGSGX554GLDriver`SubmitPackets + 124\nframe #3: 0x31f83cb0 GLEngine`gliPresentViewES + 168\nframe #4: 0x31f8e136 OpenGLES`-[EAGLContext presentRenderbuffer:] + 62\nframe #5: 0x002622e6 libglInterpose.dylib`EAGLContext_presentRenderbuffer(EAGLContext*, objc_selector*, unsigned int) + 370\nframe #6: 0x323f9064 SpriteKit`-[SKView _renderContent] + 1220\nframe #7: 0x3a90b0ae libdispatch.dylib`_dispatch_client_callout + 22\nframe #8: 0x3a90f8f2 libdispatch.dylib`_dispatch_barrier_sync_f_invoke + 26\nframe #9: 0x323f8b72 SpriteKit`-[SKView renderContent] + 82\nframe #10: 0x323f651a SpriteKit`__29-[SKView setUpRenderCallback]_block_invoke + 130\nframe #11: 0x32418c86 SpriteKit`-[SKDisplayLink _callbackForNextFrame:] + 254\nframe #12: 0x002615fe libglInterpose.dylib`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270\nframe #13: 0x321d7ad2 QuartzCore`CA::Display::DisplayLinkItem::dispatch() + 98\nframe #14: 0x321d787c QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 344\nframe #15: 0x34dd476c IOMobileFramebuffer`IOMobileFramebufferVsyncNotifyFunc + 104\nframe #16: 0x30a5ebe4 IOKit`IODispatchCalloutFromCFMessage + 248\nframe #17: 0x2fd3cb80 CoreFoundation`__CFMachPortPerform + 136\nframe #18: 0x2fd47776 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34\nframe #19: 0x2fd47712 CoreFoundation`__CFRunLoopDoSource1 + 346\nframe #20: 0x2fd45ede CoreFoundation`__CFRunLoopRun + 1406\nframe #21: 0x2fcb0470 CoreFoundation`CFRunLoopRunSpecific + 524\nframe #22: 0x2fcb0252 CoreFoundation`CFRunLoopRunInMode + 106\nframe #23: 0x349b72ea GraphicsServices`GSEventRunModal + 138\nframe #24: 0x32565844 UIKit`UIApplicationMain + 1136\nframe #25: 0x000bd1bc SpritekitCrash`main(argc=1, argv=0x27d4dc5c) + 116 at main.m:16\n<\/code><\/pre>\n<p>Since it said EXC_BAD_ACCESS, I suspected zombie-objects, but enabling them in the scheme didn&#8217;t help a thing in understanding this crash.<\/p>\n<p>This even happens in the most minimalistic project setup (literally 2 lines of code) in MyScene.m:<\/p>\n<pre><code>self.arrSounds = [[NSMutableDictionary alloc] init];\n[self.arrSounds setObject:[SKAction playSoundFileNamed:[NSString stringWithFormat:@\"70.caf\"] waitForCompletion:NO] forKey:[NSString stringWithFormat:@\"1\"]];\n<\/code><\/pre>\n<p>How is this possible?<\/p>\n<p>You can download this project from my github page: https:\/\/github.com\/SabatinoMasala\/SpritekitCrash<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Allright guys, I&#8217;ve been developing an app in which I have a NSMutableDictionary with an SKAction object in it. The SKAction is for playing a sound. This all works well, except &#8230; the app crashes upon entering background with the following stack trace: * thread #1: tid = 0x187d7, 0x3461b932 libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient + 10, queue = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3557","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3557"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3557\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}