Closed dtaddisF42 closed 3 years ago
You've provided a callstack for the warning message. What is the callstack for the crash?
Here you go, straight outta Xcode:
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x00000001092a51b0 in GC_mark_from at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/mark.c:851
#1 0x00000001092a0ef8 in GC_mark_some ()
#2 0x00000001092a048c in GC_stopped_mark at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:832
#3 0x000000010929fd58 in GC_maybe_gc at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:485
#4 0x00000001092a0c48 in GC_collect_a_little_inner at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:705
#5 0x00000001092a2ebc in GC_allocobj at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:1563
#6 0x000000010929c744 in GC_generic_malloc_inner at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/malloc.c:191
#7 0x00000001092a30e8 in GC_generic_malloc at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/malloc.c:251
#8 0x00000001092a5fa4 in GC_malloc_kind_global at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/malloc.c:327
#9 0x00000001092d8948 in il2cpp::vm::Object::Allocate(unsigned long, Il2CppClass*) [inlined] at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/libil2cpp/vm/Object.cpp:56
#10 0x00000001092d8944 in il2cpp::vm::Array::NewSpecific(Il2CppClass*, unsigned long) at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/libil2cpp/vm/Array.cpp:148
#11 0x00000001067627a0 in ::LocationManager_Update_m95CFBE16E9B830C2B3CFE2F97BE7372ACC055AFE(LocationManager_tA810AFCA3F5E2D5A515078F48C2138A0ECF0EB33 *, const RuntimeMethod *) at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/Native/Assembly-CSharp.cpp:8552
#12 0x0000000107159538 in RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void (*)(), MethodInfo const*, void*, void**) at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/Native/Il2CppInvokerTable.cpp:31897
#13 0x00000001092f735c in il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/libil2cpp/vm/Runtime.cpp:565
#14 0x0000000108b0dca4 in ::scripting_method_invoke() at /Users/bokken/buildslave/unity/build/Runtime/ScriptingBackend/Il2Cpp/ScriptingApi_Il2Cpp.cpp:285
#15 0x0000000108b1bc24 in ::Invoke() at /Users/bokken/buildslave/unity/build/Runtime/Scripting/ScriptingInvocation.cpp:273
#16 0x0000000108b298e0 in Invoke [inlined] at /Users/bokken/buildslave/unity/build/Runtime/Scripting/ScriptingInvocation.h:68
#17 0x0000000108b298cc in CallMethodIfAvailable [inlined] at /Users/bokken/buildslave/unity/build/Runtime/Mono/MonoBehaviour.cpp:418
#18 0x0000000108b2989c in ::CallUpdateMethod() at /Users/bokken/buildslave/unity/build/Runtime/Mono/MonoBehaviour.cpp:517
#19 0x00000001086cd448 in UpdateBehaviour [inlined] at /Users/bokken/buildslave/unity/build/Runtime/GameCode/Behaviour.cpp:178
#20 0x00000001086cd43c in ::CommonUpdate<BehaviourManager>() at /Users/bokken/buildslave/unity/build/Runtime/GameCode/Behaviour.cpp:156
#21 0x00000001086cd310 in ::Update() at /Users/bokken/buildslave/unity/build/Runtime/GameCode/Behaviour.cpp:173
#22 0x000000010887f75c in ::Forward() at /Users/bokken/buildslave/unity/build/Runtime/Misc/Player.cpp:1518
#23 0x0000000108876fa8 in ::ExecutePlayerLoop() at /Users/bokken/buildslave/unity/build/Runtime/Misc/PlayerLoop.cpp:350
#24 0x0000000108877000 in ::ExecutePlayerLoop() at /Users/bokken/buildslave/unity/build/Runtime/Misc/PlayerLoop.cpp:367
#25 0x00000001088772b8 in ::PlayerLoop() at /Users/bokken/buildslave/unity/build/Runtime/Misc/PlayerLoop.cpp:435
#26 0x0000000108eae588 in UnityPlayerLoopImpl ()
#27 0x000000010674b120 in UnityRepaint at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:281
#28 0x000000010674b0d4 in -[UnityAppController(Rendering) repaint] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:90
#29 0x000000010674affc in -[UnityAppController(Rendering) repaintDisplayLink] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:71
#30 0x00000001a7047558 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#31 0x00000001a7120374 in display_timer_callback(__CFMachPort*, void*, long, void*) ()
#32 0x00000001a3cd7dd0 in __CFMachPortPerform ()
#33 0x00000001a3cfcfe8 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#34 0x00000001a3cfc378 in __CFRunLoopDoSource1 ()
#35 0x00000001a3cf608c in __CFRunLoopRun ()
#36 0x00000001a3cf521c in CFRunLoopRunSpecific ()
#37 0x00000001bad74784 in GSEventRunModal ()
#38 0x00000001a672e200 in -[UIApplication _run] ()
#39 0x00000001a6733a74 in UIApplicationMain ()
#40 0x000000010674a7b0 in -[UnityFramework runUIApplicationMainWithArgc:argv:] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/main.mm:96
#41 0x0000000100cdbde4 in main at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/MainApp/main.mm:26
#42 0x00000001a39b56c0 in start ()
Also occurring in Unity 2020.1.14f1 with URP 8.2.0.
This doesn't look like it is related to the warning, or URP in general.
What is the LocationManager? Based on the callstack, it looks like a MonoBehaviour, and the crash stems from its Update method. Is that a script in your project?
Yes, that is indeed a script in our project! Thanks, I'll take another look and report back soon.
Ok, I commented out everything in our LocationManager (it was formatting some strings, nothing too weird) and rebuilt. I'm still getting a GC-related crash:
Thread 1 Queue : com.apple.main-thread (serial)
#0 0x0000000109e25220 in GC_mark_from at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/mark.c:851
#1 0x0000000109e20f68 in GC_mark_some ()
#2 0x0000000109e204fc in GC_stopped_mark at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:832
#3 0x0000000109e1fdc8 in GC_maybe_gc at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:485
#4 0x0000000109e20cb8 in GC_collect_a_little_inner at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:705
#5 0x0000000109e1fc8c in GC_collect_a_little at /Users/bokken/buildslave/unity/build/External/il2cpp/builds/external/bdwgc/alloc.c:719
#6 0x0000000109699f30 in ::CollectIncremental() at /Users/bokken/buildslave/unity/build/Runtime/Scripting/GarbageCollector.cpp:95
#7 0x000000010909fdb4 in ::EndSyncFrame() at /Users/bokken/buildslave/unity/build/Runtime/Input/TimeManager.cpp:259
#8 0x00000001093f7334 in ::PlayerLoop() at /Users/bokken/buildslave/unity/build/Runtime/Misc/PlayerLoop.cpp:441
#9 0x0000000109a2e5f8 in UnityPlayerLoopImpl ()
#10 0x00000001072cbbf0 in UnityRepaint at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:281
#11 0x00000001072cbba4 in -[UnityAppController(Rendering) repaint] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:90
#12 0x00000001072cbacc in -[UnityAppController(Rendering) repaintDisplayLink] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/UnityAppController+Rendering.mm:71
#13 0x00000001a7047558 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#14 0x00000001a7120374 in display_timer_callback(__CFMachPort*, void*, long, void*) ()
#15 0x00000001a3cd7dd0 in __CFMachPortPerform ()
#16 0x00000001a3cfcfe8 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#17 0x00000001a3cfc378 in __CFRunLoopDoSource1 ()
#18 0x00000001a3cf608c in __CFRunLoopRun ()
#19 0x00000001a3cf521c in CFRunLoopRunSpecific ()
#20 0x00000001bad74784 in GSEventRunModal ()
#21 0x00000001a672e200 in -[UIApplication _run] ()
#22 0x00000001a6733a74 in UIApplicationMain ()
#23 0x00000001072cb280 in -[UnityFramework runUIApplicationMainWithArgc:argv:] at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/Classes/main.mm:96
#24 0x0000000104e3fde4 in main at /Users/daddis/dev/GPApp/Builds/GP_iOS_Debug/MainApp/main.mm:26
#25 0x00000001a39b56c0 in start ()
If I disable the AR Camera Background behaviour on the AR Camera, the crash goes away (of course then I just get a black screen, with some digital content).
Please submit a bug with a project that reproduces the crash.
Ok, will do.
Apologies, it does seem to be an unrelated crash.
Also in the console there were some errors where I was trying to get Input.location.lastData before LocationServices were running, once I guarded against that the crash went away.
I was pretty confused since the ARCameraBackground seemed to go hand in hand with the crash, but I think that was a coincidence/red herring.
I was pretty confused since the ARCameraBackground seemed to go hand in hand with the crash, but I think that was a coincidence/red herring.
Memory issues often are like that; no worries! Glad you resolved it.
Unity bug report case number
Describe the bug I encounter a crash very often when using the URP, ARFoundation 4.1.1 and the camera background feature. I get many of these printed in my XCode console, and eventually a crash in the garbage collector:
To Reproduce Steps to reproduce the behavior:
Smartphone (please complete the following information):