Search Unity

BatchDeleteObjects Crash - Unity 5

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

  1. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Hi,

    We are running 5.0.1P1 I'm not sure when this crash started happening, but it must be sometime within the last 3 weeks.

    We have an intermittent crash that occurs when we are transitioning from some of our main game scenes to the FE / results screens etc. It occurs maybe 15% of the time and seems quite random.

    I have tried to get some crash log information, I have only reproduced this problem with Release,IL2CPP, Arm 64 builds so far. It didn't seem to occur when I was using Mono runtime... (from what I could tell). I have never seen this crash in the Editor, only on iOS builds.

    The crash log doesn't give me much other than:

    Thread 3 name: BatchDeleteObjects
    Thread 3 Crashed:
    0 ABC 0x0000000100d195b4 0x100060000 + 13342132
    1 ABC 0x0000000100d15ad0 0x100060000 + 13327056
    2 ABC 0x0000000100d156d4 0x100060000 + 13326036
    3 ABC 0x0000000100cf5dd4 0x100060000 + 13196756
    4 ABC 0x0000000100886d4c 0x100060000 + 8547660
    5 ABC 0x000000010085c844 0x100060000 + 8374340
    6 ABC 0x000000010085c780 0x100060000 + 8374144
    7 ABC 0x0000000100863874 0x100060000 + 8403060
    8 ABC 0x0000000100601754 0x100060000 + 5904212
    9 ABC 0x000000010071b828 0x100060000 + 7059496
    10 ABC 0x000000010079c704 0x100060000 + 7587588
    11 libsystem_pthread.dylib 0x0000000197847dc4 _pthread_body + 160
    12 libsystem_pthread.dylib 0x0000000197847d20 _pthread_start + 156
    13 libsystem_pthread.dylib 0x0000000197844ef4 thread_start + 0

    At this point the main thread is doing this:

    Thread 0 name: Dispatch queue: com.apple.main-thread
    Thread 0:
    0 libsystem_kernel.dylib 0x0000000197790e0c mach_msg_trap + 8
    1 libsystem_kernel.dylib 0x0000000197790c84 mach_msg + 68
    2 IOKit 0x000000018723deb0 io_connect_method + 360
    3 IOKit 0x00000001871ee03c IOConnectCallMethod + 168
    4 IOAccelerator 0x000000018f8beae8 ioAccelResourceFinalize + 112
    5 CoreFoundation 0x0000000185f352b0 CFRelease + 324
    6 libGPUSupportMercury.dylib 0x000000018eb50a54 gpulDeleteKernelTexture + 136
    7 libGPUSupportMercury.dylib 0x000000018eb509a0 gldReclaimTexture + 40
    8 libGPUSupportMercury.dylib 0x000000018eb50aa0 gldDestroyTexture + 40
    9 libGFXShared.dylib 0x0000000189beab7c gfxDestroyPluginTexture + 64
    10 GLEngine 0x0000000189b8749c gleFreeTextureObject + 44
    11 GLEngine 0x0000000189b63480 gleUnbindDeleteHashNamesAndObjects + 228

    It makes sense that it's crashing during the cleanup of the scene as my main game scenes will be unloading at the point it crashes so we can load in the FE/Result scenes.

    This is after selecting Re-Symbolicate log from the Device logs window. I have tried to make sure I have my XCode project setup to give me all the debug info, I am using this post process step to set that up for me:

    https://gist.github.com/tenpn/f8da1b7df7352a1d50ff

    Can anyone shed any light on what I could do to try and track this further? I can't reproduce this in a simple project so reporting as a bug with an example is pretty much out of the question.

    Thanks.
     
    Last edited: Apr 24, 2015
  2. mjohnsonOOO

    mjohnsonOOO

    Joined:
    Apr 10, 2014
    Posts:
    6
    I'm running into the same issue. As far as I know, it started with 5.0.1p1. Using IL2CPP, targeting iOS 7 or 8 SDK.

    I've been able to symbolicate my crash report for some more details:

    Thread 3 name: BatchDeleteObjects
    Thread 3 Crashed:
    0 --- 0x0000000101bd8704 il2cpp::eek:s::ThreadImpl::GetCurrentThread() (ThreadImpl.cpp:189)
    1 --- 0x0000000101bd8700 il2cpp::eek:s::ThreadImpl::GetCurrentThread() (ThreadImpl.cpp:189)
    2 --- 0x0000000101bd4c20 il2cpp::eek:s::posix::posixWaitObject::Wait(unsigned int, bool) (PosixWaitObject.cpp:0)
    3 --- 0x0000000101bd4824 il2cpp::eek:s::MutexImpl::Lock(bool) (MutexImpl.cpp:39)
    4 --- 0x0000000101bb4b80 il2cpp::gc::GCHandle::GetTarget(unsigned int) (GCHandle.cpp:186)
    5 --- 0x00000001016bbb4c TrackedReferenceBase::~TrackedReferenceBase() (RefCounted.h:21)
    6 --- 0x000000010168bb70 Animation::ReleaseAnimationStates() (Animation.cpp:1886)
    7 --- 0x00000001016934b0 Animation::~Animation() (Animation.cpp:67)
    8 --- 0x000000010132037c delete_object_internal_step2(Object*) (BaseObject.cpp:1329)
    9 --- 0x0000000101486624 BatchDeleteStep2Threaded(void*) (BatchDeleteObjects.cpp:104)
    10 --- 0x000000010153aaac Thread::RunThreadWrapper(void*) (Thread.cpp:40)
    11 libsystem_pthread.dylib 0x00000001938b3dc4 _pthread_body + 156
    12 libsystem_pthread.dylib 0x00000001938b3d20 _pthread_start + 152
    13 libsystem_pthread.dylib 0x00000001938b0ef4 start_wqthread + 4


    This is occurring after destroying GameObjects that had Animations using AnimationClips.

    I haven't yet tried this on 5.0.1p2, but the patch log does not look like it would solve this issue. I also haven't tried going back to 5.0.1f1, but that is likely my next step in debugging, which unfortunately means re-implementing all the workarounds for HTTPS, generic type reflection and non-colored vertex meshes.
     
  3. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Good to know it's not just us seeing this!

    We also think it started in 5.0.1p1 (based on when I sent out a Unity upgrade e-mail and when we first got reports about crashes).

    We are just about to try 5.0.1p3 which has a fix for:

    • (684129) - iOS/IL2CPP: Match the behavior of the Mono scripting backend by not stripping the Animation code from the engine when code stripping is enabled.
    Could be related...

    Let me know if you try 5.0.1f1 and it fixes the problem, I'll do the same with 5.0.1p3.
     
  4. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Just reproduced the crash in 5.0.1p3 :/

    The callstack in Xcode looks pretty much the same as what you are reporting mjohnsonOOO.
     
    Last edited: Apr 29, 2015
  5. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
  6. mjohnsonOOO

    mjohnsonOOO

    Joined:
    Apr 10, 2014
    Posts:
    6
    I tried 5.0.1p3 today, and it worked for me. Then I saw your post on how you were still seeing the issue and that got me thinking on what I was doing differently. I had put in a few potential workarounds to try and get around the bug when building against 5.0.1p1, so I took those out and saw the crashing again immediately.

    The workarounds I did were:

    1. The AnimationClips I had were being re-used in multiple Animations. I was just instantiating one version of each clip and assigning them to whichever Animation needed to use it. I changed that to instantiate a new AnimationClip each time one was being added to an Animation.
    2. Also, on any GameObject that had an Animation component, I added an OnDestroy which would call Animation.Stop and Animation.RemoveClip for every AnimationClip.
    With this combination, I haven't seen the crash again. Although I haven't done a long term test to see if this just ends up masking the issue for longer. But it went from crashing within the first 2 times of creating and destroying a number of animating GameObjects, to being able to run that cycle tens of times without issue.

    I still haven't been able to put together a simple test project to replicate the issue, but have some better ideas now that these workarounds seem to be doing something. I'm also in a position where I cannot submit the full project to Unity for bug reporting.

    Hope this can help.
     
  7. AmirLevi

    AmirLevi

    Joined:
    Dec 5, 2012
    Posts:
    12
    I am getting the same errors, the problem is, it happen randomly and i cant reproduce the problem
    I've tried it on 5.0.1p1 - 5.0.1p3 IOS builds

    here is the log in xcode:

    BatchDeleteObjects (10)
    #0 0x01a3ccbb in il2cpp::eek:s::ThreadImpl::GetCurrentThread() ()
    #1 0x01a38ede in il2cpp::eek:s::posix::posixWaitObject::Wait(unsigned int, bool) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/PosixWaitObject.cpp:90
    #2 0x01a38a9f in il2cpp::eek:s::MutexImpl::TryLock(unsigned int, bool) [inlined] at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/MutexImpl.cpp:39
    #3 0x01a38a7b in il2cpp::eek:s::MutexImpl::Lock(bool) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/MutexImpl.cpp:26
    #4 0x01a332cb in il2cpp::eek:s::Mutex::Lock(bool) at /Users/builduser/buildslave/unity/build/Runtime/Threads/Mutex.cpp:30
    #5 0x01a14530 in il2cpp::gc::GCHandle::GetTarget(unsigned int) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/gc/GCHandle.cpp:186
    #6 0x01285006 in ~TrackedReferenceBase at /Users/builduser/buildslave/unity/build/./Runtime/BaseClasses/RefCounted.h:23
    #7 0x012473a6 in ReleaseAnimationStates at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.cpp:1886
    #8 0x0124f85b in ThreadedCleanup [inlined] at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.cpp:67
    #9 0x0124f853 in ~Animation at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.h:84
    #10 0x00da2235 in delete_object_internal_step2 at /Users/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.cpp:1329
    #11 0x00f48f57 in BatchDeleteStep2Threaded at /Users/builduser/buildslave/unity/build/Runtime/Misc/BatchDeleteObjects.cpp:105
    #12 0x00ff3f2f in RunThreadWrapper at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:40
    #13 0x08ddce13 in _pthread_body ()
    #14 0x08ddcd89 in _pthread_start ()
    #15 0x08ddae52 in thread_start ()
     
  8. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I think I'm running into this as well. Happens randomly when I try to leave certain scenes and go to a new one. It doesn't happen all the time on those scenes ... just randomly. It used to happen a lot more frequently, but setting the iOS to 8.0 and Disabling stripping level in IL2CPP seems to have helped. However, it still seems to happen and I do get the same error message in Xcode around delete objects.

    I'm going to try the animation workarounds that were suggested and see if that helps. I may also be able to provide a bug report and reproduction case.
     
  9. mjohnsonOOO

    mjohnsonOOO

    Joined:
    Apr 10, 2014
    Posts:
    6
    So after doing some longer tests, I ended up still hitting the BatchDeleteObjects crash. I have gone back to 5.0.1f1, and have not gotten the crash since, so it seems to confirm that the bug was introduced with the 5.0.1p1 patch.
     
  10. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    That's unfortunate. I'm trying to create a reproduction project now. Hopefully I can reproduce it and submit a bug report.
     
  11. mjohnsonOOO

    mjohnsonOOO

    Joined:
    Apr 10, 2014
    Posts:
    6
    I have created a sample project that causes the crash and have submitted a bug report: Case 694004
     
    Rajmahal likes this.
  12. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Fantastic ... I was trying to do the same but my sample project wasn't replicating the crash.
     
  13. Enkiduouo

    Enkiduouo

    Joined:
    Mar 7, 2015
    Posts:
    13
    Also seeing this 5.0.1p1->p3 - can repro 100% of the time when trying to transition scenes, will attempt the animation fixes - sadly also cannot submit my project to unity - hopefully they will jump on the bug report - jumping from one broken version of unity to another is getting tiring.

    Here is my stack :

    #0 0x0242d0cc in il2cpp::eek:s::ThreadImpl::GetCurrentThread() ()
    #1 0x02428c54 in il2cpp::eek:s::posix::posixWaitObject::Wait(unsigned int, bool) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/PosixWaitObject.cpp:90
    #2 0x024285f8 in il2cpp::eek:s::MutexImpl::TryLock(unsigned int, bool) [inlined] at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/MutexImpl.cpp:39
    #3 0x024285d4 in il2cpp::eek:s::MutexImpl::Lock(bool) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/os/Posix/MutexImpl.cpp:26
    #4 0x023fb808 in il2cpp::gc::GCHandle::GetTarget(unsigned int) at /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/gc/GCHandle.cpp:186
    #5 0x01f2dc90 in ~TrackedReferenceBase at /Users/builduser/buildslave/unity/build/./Runtime/BaseClasses/RefCounted.h:23
    #6 0x01eef024 in ReleaseAnimationStates at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.cpp:1886
    #7 0x01eeef64 in ThreadedCleanup at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.cpp:67
    #8 0x01ef8034 in ~Animation at /Users/builduser/buildslave/unity/build/Runtime/Animation/Animation.h:84
    #9 0x01ba2ca0 in delete_object_internal_step2 at /Users/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.cpp:1329
    #10 0x01d15d70 in BatchDeleteStep2Threaded at /Users/builduser/buildslave/unity/build/Runtime/Misc/BatchDeleteObjects.cpp:105
    #11 0x01dbd8b8 in RunThreadWrapper at /Users/builduser/buildslave/unity/build/Runtime/Threads/Thread.cpp:40
    #12 0x38e22e66 in _pthread_body ()
    #13 0x38e22dda in _pthread_start ()
    #14 0x38e20b84 in thread_start ()
     
  14. Enkiduouo

    Enkiduouo

    Joined:
    Mar 7, 2015
    Posts:
    13
    Do a manual animation cleanup before doing Application.LoadLevelAsync transitions seems to be a functional workaround :
    Thanks for the input though group, saved me a ton of work.

    voidDoManualAnimationCleanup ()
    {
    foreach(AnimationainFindObjectsOfType(typeof(Animation))) {
    a.Stop();

    List<string> clipNames = newList<string>();
    foreach(AnimationState v in a)
    clipNames.Add(v.clip.name);

    foreach(stringsinclipNames)
    a.RemoveClip(s);
    }
    }
     
    Rajmahal likes this.
  15. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm starting to run into the crash again .... I'm going to try your code. I take it is just a function you run right before you running Application.LoadLevelAsynch?
     
  16. Enkiduouo

    Enkiduouo

    Joined:
    Mar 7, 2015
    Posts:
    13
    Yes -

    I was getting occasional crashes as well and exceptions in this line
    a.RemoveClip(s);

    So I wrapped that in a try / catch block so that it keeps trying to remove other animations if it fails on one - that seems to be working for me now.
     
  17. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    What type of exception did you catch for? Was it a null reference exception ... occurring if a was null, for example? Do you mind just adding that to the original code you shared?
     
  18. Enkiduouo

    Enkiduouo

    Joined:
    Mar 7, 2015
    Posts:
    13
    Nothing exciting or clever :

    void DoManualAnimationCleanup ()
    {
    foreach(Animation a in FindObjectsOfType(typeof(Animation))) {
    a.Stop();

    List<string> clipNames = new List<string>();
    foreach(AnimationState v in a)
    clipNames.Add(v.clip.name);

    foreach(string s in clipNames) {
    try {
    a.RemoveClip(s);
    } catch (Exception e) {
    Debug.LogWarning("Failed to remove animation : " + e.ToString());
    }
    }
    }
    }
     
    gwiazdorrr and Rajmahal like this.
  19. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks ... appreciate the help.
     
  20. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Specifically what type of Exception do you try to catch for? If I try the generic Exception that you have in the code, Unity kicks up an error. Is it a UnityException or one of the other types?
     
  21. Pr3s4ri0

    Pr3s4ri0

    Joined:
    Mar 5, 2013
    Posts:
    11
  22. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
  23. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I really hope this gets fixed soon.
     
  24. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Seems like the workaround hasn't worked for me fully as I'm still running into the crash. Does anyone know if unity are working on this issue?
     
  25. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Anyone know if this was fixed in 5.0.2?
     
  26. mjohnsonOOO

    mjohnsonOOO

    Joined:
    Apr 10, 2014
    Posts:
    6
    AFAIK, not fixed yet. 5.0.2 looks like just rolling up all the 5.0.1 patches. They have reproduced the bug in my report (case 694004) and it's been sent it to dev for resolution. I haven't received any further updates, so I assume they haven't fixed it yet.
     
  27. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Great ... that's good news. At least a developer is looking at it. It's just killing my project right now and I'm about 20 days from my planned release date. Really hoping they fix it.
     
  28. mechagon

    mechagon

    Joined:
    Jan 9, 2014
    Posts:
    7
    Anyone able to reproduce this with 5.0.2p1? I guess it might be fixed since I cannot get it to crash anymore..
     
  29. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    that's promising ... I'll download today and check. How aggressively have you tested for it in 5.0.2p1? It's very random for me. I thought it was fixed for 3 or 4 days in an earlier patch release before it finally started happening again.
     
  30. mechagon

    mechagon

    Joined:
    Jan 9, 2014
    Posts:
    7
    I used to get it in scene changes quite easily, like every 4th or 5th time. But I guess it varies a bit depending on what's happening in the scene change and it could be that I was just lucky..
     
  31. mechagon

    mechagon

    Joined:
    Jan 9, 2014
    Posts:
    7
    And to actually answer your question: Not that heavily since I'm not in a hurry with the fix right now. So you probably want to do a lot more testing with that!
     
  32. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Haven't seen it either in my tests. They might have actually fixed it.
     
  33. TFChane

    TFChane

    Joined:
    Nov 14, 2012
    Posts:
    1
  34. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Seems fixed in 5.0.2p1. Do you have access to a beta of 5.1.0?
     
  35. eczkchtl

    eczkchtl

    Joined:
    Dec 12, 2012
    Posts:
    14
    We're having the same issue in Unity 5.1.0f3.
    Our game crashes when the GameObject with the animations is destroyed. It only happens on iOS when using IL2CPP. Check out the stack trace in the screenshot.
     

    Attached Files:

  36. eczkchtl

    eczkchtl

    Joined:
    Dec 12, 2012
    Posts:
    14
    This seems to be fixed in the patch 5.0.3p1 that came out yesterday, a few days after 5.1.0f3.
     
  37. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    102
    If they did fix it, it's not in the release notes.

    I can confirm that the fix by Enkiduouo works in our case (5.0.2f1). I modified it slightly, so that it doesn't throw.
    Code (CSharp):
    1.     private static void DoManualAnimationCleanup()
    2.     {
    3.         foreach (Animation a in FindObjectsOfType(typeof(Animation)))
    4.         {
    5.             a.Stop();
    6.  
    7.             var clips = new HashSet<AnimationClip>();
    8.  
    9.             foreach (AnimationState v in a)
    10.             {
    11.                 clips.Add(v.clip);
    12.             }
    13.  
    14.             foreach (var c in clips)
    15.             {
    16.                 a.RemoveClip(c);
    17.             }
    18.         }
    19.     }
     
  38. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    The issue was definitely fixed in a patch release for 5.0.X ... not sure exactly when. I haven't run into it in quite a while. Hopefully it has been fixed in 5.1.0p1 ... I'll download later and check. When they fixed it, they didn't mention it in the release notes.
     
  39. mechagon

    mechagon

    Joined:
    Jan 9, 2014
    Posts:
    7
    It seems working (again) for my specific case in 5.1.0p1. But make your own judgements, the issue hasn't been closed in Issue tracker so probably it's working more or less by accident as it was in 5.0.2p1. But couldn't reproduce it now, when it was easy to reproduce in 5.1.0.
     
  40. Fabien Renaud

    Fabien Renaud

    Joined:
    Apr 7, 2014
    Posts:
    5
    Issue is still happening for me with Unity 5.1.0f3
     
    MrEsquire likes this.
  41. mechagon

    mechagon

    Joined:
    Jan 9, 2014
    Posts:
    7
    Did you try with 5.1.0p1? It seemed to fix the issue for me but would be nice to know if it worked for anyone else
     
  42. borrismoose

    borrismoose

    Joined:
    Dec 28, 2011
    Posts:
    6
    I tried the approach posted by Enkiduouo / gwiazdorrr and it worked for me with one caveat. If you have Animation components in the scene that are not active (or their gameobject is not active) then a crash can still occur. To solve this, instead of using 'FindObjectsOfType', make sure all of your objects are underneath a scene root GameObject in the Hierarchy. Then you can use this slightly modified version of the function that takes the root GameObject as a parameter.

    Code (CSharp):
    1.  
    2.     private void DoManualAnimationCleanup (GameObject rootGO)
    3.     {
    4.         if (rootGO != null)
    5.         {
    6.             Animation[] animationArray = rootGO.GetComponentsInChildren<Animation> (true);
    7.             foreach (Animation a in animationArray)
    8.             {
    9.                 a.Stop ();
    10.                    
    11.                 var clips = new HashSet<AnimationClip> ();
    12.                    
    13.                 foreach (AnimationState v in a)
    14.                 {
    15.                     clips.Add (v.clip);
    16.                 }
    17.                    
    18.                 foreach (var c in clips)
    19.                 {
    20.                     a.RemoveClip (c);
    21.                 }
    22.             }
    23.         }
    24.     }
    NOTE: I am using Unity v5.1.0f3.
     
    Last edited: Jun 24, 2015
  43. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    5.1.0 p1 seems to have fixed it for me too.
     
  44. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    Have seen this crash appear with build created using Unity 5.1.1f. Pretty frustrating. I haven't been able to reproduce this consistently. It even seems like the crash won't appear on the same device twice. But there are several instances on this crash in our current live version of our game which all point BatchDelete. Not sure if the scene we are swapping from contains Animations, but will investigate this as a fix.
     
  45. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    There doesn't seem to be any sign of animation in the offending scene. Does this issue effect some other component? There is alot of nGUI UI components in this scene.
     
  46. Culzean

    Culzean

    Joined:
    Jan 25, 2014
    Posts:
    48
    I could be wrong with the version of Unity I used for my app that has exhibited this crashed. I built it on the 18th which is the same day that Unity 5.1.1 came out.. does anyone know of a way to check the Unity version number used from the xcarchive? Anyway I was previously using 5.1.0f3 and now a build with 5.1.1f1 seems to be cleared of this issue.
     
  47. Jakhongir

    Jakhongir

    Joined:
    May 12, 2015
    Posts:
    37
    Hello, I have the same issue, Unity version is 5.1.0f1. Game crashes only on iOS devices, when changing scene from my gameScene to gameOverScene[actually to any scene]. There is no crash In the editor and on Android devices. XCODE says [could anyone tell me what that means]:
    0x1132a00: ldr r0, [r0] BatchDeleteObjects(9): EXC_BAD_ACCESS

    and...

    thread #1: tid = 0x1eb99d, 0x009d5df8 starpatrol`AddToBatchDeleteAndMakeUnpersistent [inlined] AddOneBatchDeleteObject + 32 at BatchDeleteObjects.h:36, queue = 'com.apple.main-thread'

    frame #0: 0x009d5df8 starpatrol`AddToBatchDeleteAndMakeUnpersistent [inlined] AddOneBatchDeleteObject + 32 at BatchDeleteObjects.h:36

    frame #1: 0x009d5dd8 starpatrol`AddToBatchDeleteAndMakeUnpersistent + 28 at GameObjectUtility.cpp:1196

    frame #2: 0x009d4f16 starpatrol`DestroyGameObjectRecursive + 170 at GameObjectUtility.cpp:1225

    frame #3: 0x009d4e9c starpatrol`DestroyGameObjectRecursive + 48 at GameObjectUtility.cpp:1210

    frame #4: 0x009d4e9c starpatrol`DestroyGameObjectRecursive + 48 at GameObjectUtility.cpp:1210

    frame #5: 0x009d4e9c starpatrol`DestroyGameObjectRecursive + 48 at GameObjectUtility.cpp:1210

    frame #6: 0x009d4f72 starpatrol`DestroyGameObjectHierarchy + 62 at GameObjectUtility.cpp:1330

    frame #7: 0x009d527e starpatrol`DestroyObjectHighLevel + 770 at GameObjectUtility.cpp:1468

    frame #8: 0x009f12be starpatrol`UnloadGameScene + 302 at SceneUnloading.cpp:34

    frame #9: 0x009daabc starpatrol`LoadScene + 328 at Player.cpp:1216

    frame #10: 0x009dfbde starpatrol`IntegrateMainThread + 194 at LoadSceneOperation.cpp:199

    frame #11: 0x009ddf80 starpatrol`UpdatePreloadingSingleStep + 236 at PreloadManager.cpp:416

    frame #12: 0x009de352 starpatrol`WaitForAllAsyncOperationsToComplete + 146 at PreloadManager.cpp:476

    frame #13: 0x009de4b8 starpatrol`UpdatePreloading + 208 at PreloadManager.cpp:509

    frame #14: 0x009dc0e4 starpatrol`PlayerLoop + 584 at Player.cpp:1667

    frame #15: 0x007f5532 starpatrol`UnityPlayerLoopImpl + 14 at LibEntryPoint.mm:234

    frame #16: 0x0009ca24 starpatrol`UnityRepaint + 84 at UnityAppController+Rendering.mm:246

    frame #17: 0x0009c9c8 starpatrol`-[UnityAppController(self=0x17f86570, _cmd=0x012d6faa) repaint] + 156 at UnityAppController+Rendering.mm:68

    frame #18: 0x0009c84c starpatrol`__51-[UnityAppController(.block_descriptor=<unavailable>) repaintDisplayLink]_block_invoke + 108 at UnityAppController+Rendering.mm:52
     
  48. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'd suggest updating to a later patch release. Fixed the issue for me even though unity never mentioned a fix for that bug in their defect tracker or change log.
     
  49. Jakhongir

    Jakhongir

    Joined:
    May 12, 2015
    Posts:
    37
    Some people said it is Unity bug connected with destroying objects with animations, I deleted all animations I had in my gameScene, now seems crash gone
     
  50. bachirk

    bachirk

    Joined:
    Mar 9, 2014
    Posts:
    16
    This crash is still there in 5.1.2
    when Destroying an animated object.

    EDIT: In fact this is so bad it's crashing the Editor as well, not just on the device!
     
    Last edited: Aug 2, 2015