Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Need help: ios-EXC_BAD_ACCESS (SIGABRT) crash on entering background

Discussion in 'iOS and tvOS' started by Charles Max, Apr 24, 2015.

  1. Charles Max

    Charles Max

    Joined:
    Apr 24, 2015
    Posts:
    2
    Hello guys,

    Our game crashes as soon as it goes to background. The ios crash report is attached.
    The weird thing is that it only happens on one of our test device - iphone 6 plus (ios version is 8.3). I've tested on iphone 6 with ios version 8.1 and iphone 5s and ipad with ios version 7.0.1 and they all work well. So I suspect this issue only occurs on ios 8.3.

    I have no idea on how to fix it and it is driving me crazy. I am wondering if I need upgrade my unity to higher version to fix it. (I am using Unity 3D 4.6.3)

    Stack trace:
    Code (CSharp):
    1. {\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160
    2. {\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
    3. {\colortbl;\red255\green255\blue255;}
    4. \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
    5. \deftab529
    6. \pard\tx529\pardeftab529\pardirnatural
    7.  
    8. \f0\fs22 \cf0 \CocoaLigature0 * thread #1: tid = 0x6ac04, 0x0b57083c AGXMetal`AGX::Framebuffer<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::configurePBE(AGX::G4P::Texture*, unsigned int, unsigned int, unsigned int, _AGCDrawBufferState const&, _AGCDrawBuffer const&, unsigned int, bool, bool) + 12, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x110)\
    9.     frame #0: 0x0b57083c AGXMetal`AGX::Framebuffer<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::configurePBE(AGX::G4P::Texture*, unsigned int, unsigned int, unsigned int, _AGCDrawBufferState const&, _AGCDrawBuffer const&, unsigned int, bool, bool) + 12\
    10.     frame #1: 0x0b571164 AGXMetal`AGX::Framebuffer<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::Framebuffer(AGXA8Device*, MTLRenderPassDescriptor*, unsigned int, unsigned int) + 1924\
    11.     frame #2: 0x0b57221c AGXMetal`AGX::FramebufferGen1<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::FramebufferGen1(AGXA8Device*, MTLRenderPassDescriptor*, unsigned int, unsigned int) + 44\
    12.     frame #3: 0x0b58569e AGXMetal`AGX::RenderContextImpl<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::RenderContextImpl(MTLIOAccelCommandBuffer<MTLCommandBuffer>*, MTLRenderPassDescriptor*, unsigned int, unsigned int, bool) + 554\
    13.     frame #4: 0x0b578136 AGXMetal`___lldb_unnamed_function1583$$AGXMetal + 146\
    14.     frame #5: 0x0b559f9e AGXMetal`___lldb_unnamed_function1228$$AGXMetal + 114\
    15.   * frame #6: 0x019bd558 superpanda`SetupMetalFBO(clearFlags=<unavailable>, color=<unavailable>, depth=<unavailable>, stencil=<unavailable>) + 1380 at FrameBufferMetal.mm:195\
    16.     frame #7: 0x019c06f4 superpanda`GfxDeviceMetal::Clear(this=<unavailable>, clearFlags=7, color=0x00000000, stencil=0, depth=<unavailable>) + 48 at GfxDeviceMetal.mm:1147\
    17.     frame #8: 0x016c9ce8 superpanda`GraphicsHelper::Clear(clearFlags=<unavailable>, color=<unavailable>, depth=<unavailable>, stencil=<unavailable>) + 240 at GraphicsHelper.cpp:65\
    18.     frame #9: 0x01617814 superpanda`ClearFramebuffer(gfxClearFlags=1010715200, rect=(x = 0, y = 0, width = 1920, height = 1080), color=0x047cebc0) + 148 at Camera.cpp:651\
    19.     frame #10: 0x0161775c superpanda`Camera::ClearNoSkybox(this=<unavailable>, noDepth=<unavailable>) + 452 at Camera.cpp:703\
    20.     frame #11: 0x01608570 superpanda`ForwardShaderRenderLoop: (erformRendering(this=0x047cf1b0, mainDirShadowLight=<unavailable>, existingShadowMap=<unavailable>, shadowCullData=<unavailable>, disableDynamicBatching=<unavailable>, sRGBrenderTarget=<unavailable>, clearFrameBuffer=<unavailable>) + 880 at ForwardShaderRenderLoop.cpp:518\
    21.     frame #12: 0x0160a4ec superpanda`DoForwardShaderRenderLoop(ctx=<unavailable>, objects=<unavailable>, opaque=<unavailable>, disableDynamicBatching=<unavailable>, mainShadowMap=0x00000000, activeLights=<unavailable>, linearLighting=<unavailable>, clearFrameBuffer=true) + 3004 at ForwardShaderRenderLoop.cpp:1408\
    22.     frame #13: 0x01613e54 superpanda`DoRenderLoop(loop=0x16d33a00, renderPath=kRenderPathForward, contents=0x047cf434, dontRenderRenderables=<unavailable>) + 1260 at RenderLoopPrivate.cpp:407\
    23.     frame #14: 0x016186a8 superpanda`Camera:: DoRender(this=0x16d2c220, cullResults=<unavailable>, customRender=<unavailable>, renderFlags=<unavailable>)(Camera&, RenderLoop&, CullResults&), int) + 144 at Camera.cpp:1144\
    24.     frame #15: 0x01618b3c superpanda`Camera::Render(this=0x16d2c220, cullResults=0x047cf434, renderFlags=2) + 336 at Camera.cpp:1696\
    25.     frame #16: 0x01634a58 superpanda`RenderManager::RenderCameras(this=0x17813de0) + 196 at RenderManager.cpp:94\
    26.     frame #17: 0x0173d3c4 superpanda`PlayerRender(present=<unavailable>) + 184 at Player.cpp:1597\
    27.     frame #18: 0x0173dcc8 superpanda`PlayerLoop(batchMode=<unavailable>, performRendering=<unavailable>, pHookEvt=<unavailable>) + 2064 at Player.cpp:2055\
    28.     frame #19: 0x01524c14 superpanda`UnityPlayerLoop + 36 at LibEntryPoint.mm:246\
    29.     frame #20: 0x000f8488 superpanda`UnityRepaintImpl(forced=false) + 172 at UnityAppController+Rendering.mm:200\
    30.     frame #21: 0x000f78cc superpanda`UnityRepaint + 20 at UnityAppController+Rendering.mm:211\
    31.     frame #22: 0x000f78b0 superpanda`-[UnityAppController(self=0x1677d990, _cmd=0x01f2f77c) repaint] + 156 at UnityAppController+Rendering.mm:46\
    32.     frame #23: 0x000f780c superpanda`-[UnityAppController(self=0x1677d990, _cmd=0x01f2f712) repaintDisplayLink] + 100 at UnityAppController+Rendering.mm:37\
    33.     frame #24: 0x0499ef3e libglInterpose.dylib`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270\
    34.     frame #25: 0x24ed783a QuartzCore`CA:: Display:: DisplayLinkItem::dispatch() + 98\
    35.     frame #26: 0x24ed76a2 QuartzCore`CA:: Display:: DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366\
    36.     frame #27: 0x29bbbc06 IOMobileFramebuffer`IOMobileFramebufferVsyncNotifyFunc + 90\
    37.     frame #28: 0x22d8e000 IOKit`IODispatchCalloutFromCFMessage + 256\
    38.     frame #29: 0x21dcb24c CoreFoundation`__CFMachPortPerform + 132\
    39.     frame #30: 0x21ddb7ca CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34\
    40.     frame #31: 0x21ddb766 CoreFoundation`__CFRunLoopDoSource1 + 346\
    41.     frame #32: 0x21dd9d68 CoreFoundation`__CFRunLoopRun + 1608\
    42.     frame #33: 0x21d26200 CoreFoundation`CFRunLoopRunSpecific + 476\
    43.     frame #34: 0x21d26012 CoreFoundation`CFRunLoopRunInMode + 106\
    44.     frame #35: 0x295bf200 GraphicsServices`GSEventRunModal + 136\
    45.     frame #36: 0x254caa58 UIKit`UIApplicationMain + 1440\
    46.     frame #37: 0x000e99b0 superpanda`main(argc=1, argv=0x047d1ac0) + 304 at main.mm:45}
    Please help!
     

    Attached Files:

    Last edited: Apr 27, 2015
  2. rk_wf

    rk_wf

    Joined:
    Mar 26, 2015
    Posts:
    3
    We are having the same issue running Unity 4.6.3p3 on iOS 8.3 devices only. Happens by pressing the power button on the hardware or allowing the iOS auto-lock feature to lock the device. This does not happen when forcing the Graphics API to OGLES 2.0.

    Seems to be caused by the call to UnityForcedRepaint() in the following function in UnityAppController.mm

    Code (CSharp):
    1. - (void)applicationWillResignActive:(UIApplication*)application
    2. {
    3.     printf_console("-> applicationWillResignActive()\n");
    4.  
    5.     if(_unityAppReady)
    6.     {
    7.         UnitySetPlayerFocus(0);
    8.         UnityPause(true);
    9.  
    10.         extern void UnityStopVideoIfPlaying();
    11.         UnityStopVideoIfPlaying();
    12.  
    13.         // Force player to do one more frame, so scripts get a chance to render custom screen for minimized app in task manager.
    14.         UnityForcedRepaint();
    15.     }
    16.  
    17.     _didResignActive = true;
    18. }

    Stack Trace:

    Code (CSharp):
    1. #0    0x000000010b885598 in AGX::Framebuffer<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::Framebuffer(AGXA8Device*, MTLRenderPassDescriptor*, unsigned int, unsigned int) ()
    2. #1    0x000000010b886b54 in AGX::FramebufferGen1<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::FramebufferGen1(AGXA8Device*, MTLRenderPassDescriptor*, unsigned int, unsigned int) ()
    3. #2    0x000000010b89cd38 in AGX::RenderContextImpl<AGX::G4P::Encoders, AGX::G4P::Classes, AGX::G4P::ObjClasses>::RenderContextImpl(MTLIOAccelCommandBuffer<MTLCommandBuffer>*, MTLRenderPassDescriptor*, unsigned int, unsigned int, bool) ()
    4. #3    0x000000010b88cf74 in ___lldb_unnamed_function1583$$AGXMetal ()
    5. #4    0x000000010b86a864 in ___lldb_unnamed_function1228$$AGXMetal ()
    6. #5    0x0000000101289c6c in SetupMetalFBO(unsigned int, ColorRGBAf const&, float, unsigned int) at /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/metal/FrameBufferMetal.mm:195
    7. #6    0x000000010128ce3c in GfxDeviceMetal::Clear(unsigned int, float const*, float, int) at /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/metal/GfxDeviceMetal.mm:1148
    8. #7    0x0000000100e74f14 in UnityBlitToSystemFBOMetal at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/LibEntryPoint.mm:439
    9. #8    0x00000001000e8cd4 in PreparePresentMTL at /Projects/TML/tml/Classes/Unity/MetalHelper.mm:206
    10. #9    0x00000001000def80 in PreparePresent(UnityDisplaySurfaceBase*) at /Projects/TML/tml/Classes/Unity/UnityRendering.h:235
    11. #10    0x00000001000dd850 in -[DisplayConnection present] at /Projects/TML/tml/Classes/Unity/DisplayManager.mm:230
    12. #11    0x00000001000de490 in __25-[DisplayManager present]_block_invoke at /Projects/TML/tml/Classes/Unity/DisplayManager.mm:364
    13. #12    0x00000001000de288 in __45-[DisplayManager enumerateDisplaysWithBlock:]_block_invoke at /Projects/TML/tml/Classes/Unity/DisplayManager.mm:334
    14. #13    0x0000000181e31d40 in __65-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]_block_invoke ()
    15. #14    0x0000000181e31c20 in -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] ()
    16. #15    0x00000001000de208 in -[DisplayManager enumerateDisplaysWithBlock:] at /Projects/TML/tml/Classes/Unity/DisplayManager.mm:330
    17. #16    0x00000001000de458 in -[DisplayManager present] at /Projects/TML/tml/Classes/Unity/DisplayManager.mm:362
    18. #17    0x00000001000d3134 in -[UnityAppController(Rendering) callbackPresent:] at /Projects/TML/tml/Classes/UnityAppController+Rendering.mm:87
    19. #18    0x00000001000d35c0 in PresentContext_UnityCallback at /Projects/TML/tml/Classes/UnityAppController+Rendering.mm:124
    20. #19    0x0000000100e75a5c in PresentContextGLES() at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/LibEntryPoint.mm:997
    21. #20    0x000000010128e810 in GfxDeviceMetal::PresentFrame() at /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/metal/GfxDeviceMetal.mm:1968
    22. #21    0x000000010107c61c in PresentFrame() [inlined] at /Users/builduser/buildslave/unity/build/Runtime/Misc/Player.cpp:1467
    23. #22    0x000000010107c608 in PresentAndSync() at /Users/builduser/buildslave/unity/build/Runtime/Misc/Player.cpp:1484
    24. #23    0x000000010107c684 in PresentAfterDraw(GfxDevice::PresentMode) at /Users/builduser/buildslave/unity/build/Runtime/Misc/Player.cpp:1521
    25. #24    0x000000010107ce6c in PlayerLoop(bool, bool, IHookEvent*) at /Users/builduser/buildslave/unity/build/Runtime/Misc/Player.cpp:2065
    26. #25    0x00000001000d3778 in UnityRepaintImpl(bool) at /Projects/TML/tml/Classes/UnityAppController+Rendering.mm:220
    27. #26    0x00000001000d370c in UnityForcedRepaint at /Projects/TML/tml/Classes/UnityAppController+Rendering.mm:229
    28. #27    0x00000001000e49f0 in -[UnityAppController applicationWillResignActive:] at /Projects/TML/tml/Classes/UnityAppController.mm:275
    29. #28    0x00000001869f0a88 in -[UIApplication _deactivateForReason:notify:] ()
    30. #29    0x0000000186c18148 in -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:] ()
    31. #30    0x0000000186c20dcc in __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke ()
    32. #31    0x0000000186c20d54 in -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] ()
    33. #32    0x0000000186c13fe0 in -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] ()
    34. #33    0x000000018a7513c8 in __31-[FBSSerialQueue performAsync:]_block_invoke_2 ()
    35. #34    0x0000000181f0027c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
    36. #35    0x0000000181eff384 in __CFRunLoopDoBlocks ()
    37. #36    0x0000000181efd9a8 in __CFRunLoopRun ()
    38. #37    0x0000000181e292d4 in CFRunLoopRunSpecific ()
    39. #38    0x000000018b63f6fc in GSEventRunModal ()
    40. #39    0x00000001869eefac in UIApplicationMain ()
    41. #40    0x00000001000ccd48 in main at /Projects/TML/tml/Classes/main.mm:45
    42. #41    0x0000000193df2a08 in start ()
    43.  
    Early outing of UnityForcedRepaint() fixes the issue, but that doesnt seem like a proper fix. Any help on this would be helpful.

    Thanks
     
    Last edited: Apr 28, 2015
  3. Charles Max

    Charles Max

    Joined:
    Apr 24, 2015
    Posts:
    2
    It's been two weeks. Does anyone have solution for this?I found this issue may happen on IOS 8.1 (iphone 6) too when lock the device by pressing the power button. However, it won't happen if the phone doesn't require a password to unlock.
     
  4. GameZero

    GameZero

    Joined:
    Apr 29, 2015
    Posts:
    3
    We've just encountered this exact same problem; seems fixed in version 4.6.5p2
     
  5. gamepanch

    gamepanch

    Joined:
    Jan 4, 2012
    Posts:
    12
    i have crash log please any one help me
     

    Attached Files:

  6. little_bunny

    little_bunny

    Joined:
    Dec 12, 2015
    Posts:
    5
    I have the same issue,but I don't know how to reproduce.
    I have tried all the repro that mentioned above, but not crashed.
    On 4.6.9f1, Xcode 7, IL2PCC, happening on wide range of iOS devices, iPhone / iPad, 32 / 64 bit
    Here is the raw of the crash

    Incident Identifier: 8FB678E7-C958-4599-BE3D-4E2A5F499BF2
    CrashReporter Key: DA570C89-3A32-4F7D-A2A5-35396A7CB2F3
    Hardware Model: iPhone7,2
    Process: myapp [344]
    Path: /var/mobile/Containers/Bundle/Application/867A6918-C5ED-4CE0-B201-47B9685DBE37/myapp.app/myapp
    Identifier: net.aa.myapp
    Version: 1.1.0.2718
    Code Type: ARM-64
    Parent Process: ??? [1]

    Date/Time: 2015-11-27T08:43:44Z
    OS Version: iPhone OS 9.1 (13B143)
    Report Version: 104

    Exception Type: SIGSEGV
    Exception Codes: SEGV_ACCERR at 0x258
    Crashed Thread: 0

    Thread 0 Crashed:
    0 AGXMetalG4P 0x00000001059e2a74 0x1059d4000 + 60020
    1 AGXMetalG4P 0x00000001059e3904 0x1059d4000 + 63748
    2 AGXMetalG4P 0x0000000105a283b8 0x1059d4000 + 345016
    3 AGXMetalG4P 0x0000000105a28e74 0x1059d4000 + 347764
    4 AGXMetalG4P 0x0000000105a055d0 0x1059d4000 + 202192
    5 myapp 0x00000001017db868 SetupMetalFBO(unsigned int, ColorRGBAf const&, float, unsigned int) (FrameBufferMetal.mm:195)
    6 myapp 0x00000001017dea38 GfxDeviceMetal::Clear(unsigned int, float const*, float, int) (GfxDeviceMetal.mm:1148)
    7 myapp 0x000000010155895c GraphicsHelper::Clear(unsigned int, float const*, float, int) (GraphicsHelper.cpp:65)
    8 myapp 0x00000001014afb6c ClearFramebuffer(GfxClearFlags, RectT<float>, ColorRGBAf const&) (Camera.cpp:651)
    9 myapp 0x00000001014afabc Camera::ClearNoSkybox(bool) (Camera.cpp:703)
    10 myapp 0x00000001014a15f4 ForwardShaderRenderLoop::performRendering(ActiveLight const*, RenderTexture*, ShadowCullData const&, bool, bool, bool) (ForwardShaderRenderLoop.cpp:518)
    11 myapp 0x00000001014a314c DoForwardShaderRenderLoop(RenderLoopContext&, dynamic_array<RenderObjectData, 8ul>&, bool, bool, RenderTexture*, ActiveLights&, bool, bool) (ForwardShaderRenderLoop.cpp:1408)
    12 myapp 0x00000001014ac3bc DoRenderLoop(RenderLoop&, RenderingPath, CullResults&, bool) (RenderLoopPrivate.cpp:411)
    13 myapp 0x00000001014b08ac Camera::DoRender(CullResults&, void (*)(Camera&, RenderLoop&, CullResults&), int) (Camera.cpp:1144)
    14 myapp 0x00000001014b0d6c Camera::Render(CullResults&, int) (Camera.cpp:1696)
    15 myapp 0x00000001014ca698 RenderManager::RenderCameras() (RenderManager.cpp:94)
    16 myapp 0x00000001015c76e4 PlayerRender(bool) (Player.cpp:1597)
    17 myapp 0x00000001015c7ddc PlayerLoop(bool, bool, IHookEvent*) (Player.cpp:2055)
    18 myapp 0x00000001013bb5bc UnityPlayerLoop (LibEntryPoint.mm:253)
    19 myapp 0x00000001000b94e0 UnityRepaintImpl(bool) (UnityAppController+Rendering.mm:225)
    20 myapp 0x00000001000c4804 -[UnityAppController(ViewHandling) showGameUI] (UnityAppController+ViewHandling.mm:157)
    21 myapp 0x00000001000c2fb0 -[UnityAppController startUnity:] (UnityAppController.mm:103)
    22 Foundation 0x0000000185c8a48c __NSFireDelayedPerform + 424
    23 CoreFoundation 0x0000000184d0cc3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 24
    24 CoreFoundation 0x0000000184d0c8e0 __CFRunLoopDoTimer + 880
    25 CoreFoundation 0x0000000184d09ff4 __CFRunLoopRun + 1516
    26 CoreFoundation 0x0000000184c38ca0 CFRunLoopRunSpecific + 380
    27 GraphicsServices 0x000000018fe74088 GSEventRunModal + 176
    28 UIKit 0x000000018a350ffc UIApplicationMain + 200
    29 myapp 0x00000001000b52dc main (main.mm:37)
    30 libdyld.dylib 0x000000019a1568b8 start + 0
     
    Last edited: Dec 15, 2015
  7. shokin

    shokin

    Joined:
    Oct 22, 2015
    Posts:
    5
    hi, your crash occur on unity4.9.f1?
    How to reslove the crash?
     
  8. jake-ruman

    jake-ruman

    Joined:
    Oct 21, 2016
    Posts:
    5
    I meet same error with @little_bunny , does any have any idea about this?:(