We are using Unity Performance Reporting, and are getting these errors logged quite often:
MESSAGE
ObjectDisposedException: The object was used after being disposed.
STACK TRACE
System.Threading.WaitHandle.WaitOne (Int32 millisecondsTimeout, Boolean exitContext)
System.Threading.EventWaitHandle.Reset ()
Pathfinding.RVO.Simulator+Worker.Execute (Int32 task)
Pathfinding.RVO.Simulator.OnDestroy ()
Pathfinding.RVO.Simulator.Finalize ()
UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)
I think this is also causing a native hard crash that we’ve been seeing, but the stack trace really is unusable. I suspect this because the native crash appears to be threading-related, and AFAIK A* is the only place where threads are used in our game.
EDIT: It’s actually very revealing, you can see the connection between the stack trace above and this one (Simulator_OnDestroy, Simulator_Finalize):
MESSAGE
Native Crash - il2cpp::icalls::mscorlib::System::Threading::NativeEventCalls::ResetEvent_internal(long) (Event.h)
STACK TRACE
Thread 3 (crashed)
0 mygame il2cpp::icalls::mscorlib::System::Threading::NativeEventCalls::ResetEvent_internal(long) (Event.h:39)
1 mygame Worker_Execute_m1040327398 (Bulk_Assembly-CSharp_7.cpp:4213)
2 mygame Simulator_OnDestroy_m4257592864 (Bulk_Assembly-CSharp_7.cpp:56324)
3 mygame Simulator_Finalize_m361839408 (Bulk_Assembly-CSharp_7.cpp:56356)
4 mygame RuntimeInvoker_Void_t1866870234(void (*)(), MethodInfo const*, void*, void**) (Il2CppInvokerTable.cpp:46240)
5 mygame il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (Runtime.cpp:471)
6 mygame il2cpp::gc::GarbageCollector::RunFinalizer(void*, void*) (GarbageCollector.cpp:156)
7 mygame GC_invoke_finalizers (finalize.c:992)
8 mygame il2cpp::gc::FinalizerThread(void*) (GarbageCollector.cpp:97)
9 mygame il2cpp::os::Thread::RunWrapper(void*) (Thread.cpp:110)
10 mygame il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) (ThreadImpl.cpp:106)
11 libsystem_pthread.dylib <system symbols missing>
12 libsystem_pthread.dylib <system symbols missing>
13 libsystem_pthread.dylib <system symbols missing>
Any ideas on what might be causing this? This appears to happen when switching scenes.
Note: This happened on an iPad Pro 10.5" with iOS 10.3.3.