Hello everybody,
I would like some opinions in regards to my assumption:
After upgrading to Unity 4, the project crashes on the device and working smoothly in the editor.
My assumption is that it is Unity’s fault, and not my project.
This is what I have done:
- The starting point is that the project works perfectly in Unity 3.5 - both in editor and on the device
- I installed Unity 4, allowed Unity to upgrade the project
- I modified the project to eliminate all deprecation warnings (e.g. gameObject.active changed to gameObject.SetActive() etc)
- I modified the SetActive behavior where needed, to consider the new Unity 4 approach that SetActive now works recursively (whereas gameObject.active wasn’t)
- I reached a place where the project runs smoothly again in the Editor
- Deployed to the iOS simulator or device.
- Now, crashes occur at random places, and nothing is sent back to the Xcode console. Note that I do see some other Debug.Log() commands getting back to the console, so I know I am looking at the right place and the simulator is sending messages back.
- I then tried eliminating some stuff, and reducing all objects as much as I can, but still cannot identify where is the crash.
- From what I have experienced throughout this process, it seems that there is a problem when instantiating objects.
- I would assume that if it is a null reference error that I can fix, it would either also occur in the editor, or at least, would show in the Xcode error log.
So, am I completely wrong to assume the problem is not on my part?
The results I got from the Xcode debugger are below.
Note - as the only thing I saw on crash was the word “lldb” - I googled it, and figured out it was the debugger type.
So I changed to the other Xcode debugger (GDB), hoping it may give more details. It did, but still not useful.
Using GDB debugger instead of LLDB:
[Switching to process 2196 thread 0x14d03]
sharedlibrary apply-load-rules all
warning: Trying to remove a section from the ordered section list that did not exist at 0xcee000.
warning: Trying to remove a section from the ordered section list that did not exist at 0xcee000.
Warning: the current language does not match this frame.
[unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown][unknown](gdb)
From Xcode Debug Navigator:
#0 0x001e585b in Object::GetInstanceID() const [inlined] at /Applications/buildAgent/work/812c4f5049264fad/./Runtime/BaseClasses/BaseObject.h:438
#1 0x001e5852 in CollectAndProduceGameObjectHierarchy(Unity::GameObject, Transform*, vector_map<long, long, std::less<long>, stl_allocator<std::pair<long, long>, (MemLabelIdentifier)97, 16> >*) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:46
#2 0x001e59ee in CollectAndProduceGameObjectHierarchy(Unity::GameObject, Transform*, vector_map<long, long, std::less<long>, stl_allocator<std::pair<long, long>, (MemLabelIdentifier)97, 16> >*) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:77
#3 0x001e5aef in CollectAndProduceClonedIsland(Object, vector_map<long, long, std::less<long>, stl_allocator<std::pair<long, long>, (MemLabelIdentifier)97, 16> >*) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:116
#4 0x001e5b5e in CloneObjectImpl at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:173
#5 0x001e5f6e in InstantiateObject(Object, Vector3f const, Quaternionf const, vector_map<long, long, std::less<long>, stl_allocator<std::pair<long, long>, (MemLabelIdentifier)97, 16> >) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:262
#6 0x001e607e in InstantiateObject(Object, Vector3f const, Quaternionf const) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/CloneObject.cpp:293
#7 0x0042ee80 in Object_CUSTOM_INTERNAL_CALL_Internal_InstantiateSingle(ScriptingObjectOfType<Object>, Vector3f const, Quaternionf const) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/iPhoneSimulatorPlayerUnityLib/UnityEngineObject.cpp:34
#8 0x0f9d645e in 0x0f9d645e ()
#9 0x0f9d6419 in 0x0f9d6419 ()
#10 0x0f9d63ae in 0x0f9d63ae ()
#11 0x0fddd7e7 in 0x0fddd7e7 ()
#12 0x0a7c1609 in 0x0a7c1609 ()
#13 0x0070c302 in mono_jit_runtime_invoke at /Applications/buildAgent/work/6343c66c7f51e77a/mono/mini/mini.c:4889
#14 0x008fd96a in mono_runtime_invoke at /Applications/buildAgent/work/6343c66c7f51e77a/mono/metadata/object.c:2615
#15 0x002d1be2 in scripting_method_invoke(ScriptingMethod*, MonoObject*, ScriptingArguments, MonoException**) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Scripting/Backend/Mono/ScriptingBackendApi_Mono.cpp:155
#16 0x002d1695 in ScriptingInvocation::Invoke(MonoException**) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Scripting/Backend/ScriptingInvocation.cpp:140
#17 0x002d170b in ScriptingInvocation::Invoke() at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Scripting/Backend/ScriptingInvocation.cpp:129
#18 0x002c5bee in MonoBehaviour::CallMethodIfAvailable(int) [inlined] at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp:529
#19 0x002c5b96 in MonoBehaviour::CallUpdateMethod(int) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp:602
#20 0x002c5c59 in MonoBehaviour::Update() at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp:607
#21 0x001e45d6 in BehaviourManager::UpdateBehaviour(Behaviour) [inlined] at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/Behaviour.cpp:178
#22 0x001e45ce in void BaseBehaviourManager::CommonUpdate<BehaviourManager>() at /Applications/buildAgent/work/812c4f5049264fad/Runtime/GameCode/Behaviour.cpp:157
#23 0x0029e5cc in PlayerLoop(bool, bool, IHookEvent*) at /Applications/buildAgent/work/812c4f5049264fad/Runtime/Misc/Player.cpp:1664
#24 0x0001f0cb in UnityPlayerLoop() at /Applications/buildAgent/work/812c4f5049264fad/PlatformDependent/iPhonePlayer/LibEntryPoint.mm:372
#25 0x000033bb in -[AppController Repaint] at /Users/db/Developer/unity/Teddy/Build/Classes/AppController.mm:526
#26 0x00003321 in -[AppController RepaintDisplayLink] at /Users/db/Developer/unity/Teddy/Build/Classes/AppController.mm:509
#27 0x01ec1a88 in CA::smile:isplay::smile:isplayLink::dispatch(unsigned long long, unsigned long long) ()
#28 0x01ec1bcd in CA::smile:isplay::EmulatorDisplayLink::callback(__CFRunLoopTimer*, void*) ()
#29 0x02dcd8c3 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#30 0x02dcee74 in __CFRunLoopDoTimer ()
#31 0x02d2b2c9 in __CFRunLoopRun ()
#32 0x02d2a840 in CFRunLoopRunSpecific ()
#33 0x02d2a761 in CFRunLoopRunInMode ()
#34 0x036e71c4 in GSEventRunModal ()
#35 0x036e7289 in GSEventRun ()
#36 0x0168ec93 in UIApplicationMain ()
#37 0x0000427a in main at /Users/db/Developer/unity/Teddy/Build/Classes/main.mm:22
#38 0x000023f5 in start ()