We are noticing a lot of crash issues using threads in il2cpp on android mobile vr headsets. The stacktrace makes it seem very internal to unity and threading, but it’s really hard to figure out if there is anything we can do about it? this is the desymbolicated stacktrace from the android device. It appears to happen when we starting c# tasks
#00 0x000000000007f338 /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+296) (BuildId: 21847aa9757f000b0461310a9f5e6e51)
#01 0x00000000008bae4c /data/app/com.gravitysketch.gravitysketch-d2c0lU9R7nVvoRQmAot9RQ==/lib/arm64/libil2cpp.so (BuildId: 3ff31b57838c6a4d10d7a59c8dc34eace22ac721)
std::__ndk1::enable_if<(is_same<std::__ndk1::remove_const<Il2CppInternalThread*>::type, Il2CppInternalThread*>::value) && (is_trivially_copy_assignable<Il2CppInternalThread*>::value), Il2CppInternalThread**>::type std::__ndk1::__move<Il2CppInternalThread*, Il2CppInternalThread*>(Il2CppInternalThread**, Il2CppInternalThread**, Il2CppInternalThread**)
G:/android-ndk-r21d\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\include\c++\v1\algorithm:1856:9
Il2CppInternalThread** std::__ndk1::move<Il2CppInternalThread**, Il2CppInternalThread**>(Il2CppInternalThread**, Il2CppInternalThread**, Il2CppInternalThread**)
G:/android-ndk-r21d\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\include\c++\v1\algorithm:1865:0
std::__ndk1::vector<Il2CppInternalThread*, std::__ndk1::allocator<Il2CppInternalThread*> >::erase(std::__ndk1::__wrap_iter<Il2CppInternalThread* const*>)
G:/android-ndk-r21d\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\include\c++\v1\vector:1713:0
remove_working_thread(Il2CppInternalThread*)
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/mono/ThreadPool\ThreadPoolWorkerThread.cpp:27:0
#02 0x00000000008b8908 /data/app/com.gravitysketch.gravitysketch-d2c0lU9R7nVvoRQmAot9RQ==/lib/arm64/libil2cpp.so (BuildId: 3ff31b57838c6a4d10d7a59c8dc34eace22ac721)
worker_park()
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/mono/ThreadPool\ThreadPoolWorkerThread.cpp:80:9
worker_thread(void*)
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/mono/ThreadPool\ThreadPoolWorkerThread.cpp:239:0
#03 0x000000000085c724 /data/app/com.gravitysketch.gravitysketch-d2c0lU9R7nVvoRQmAot9RQ==/lib/arm64/libil2cpp.so (BuildId: 3ff31b57838c6a4d10d7a59c8dc34eace22ac721)
il2cpp::vm::ThreadStart(void*)
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/vm\Thread.cpp:701:21
#04 0x000000000086f4dc /data/app/com.gravitysketch.gravitysketch-d2c0lU9R7nVvoRQmAot9RQ==/lib/arm64/libil2cpp.so (BuildId: 3ff31b57838c6a4d10d7a59c8dc34eace22ac721)
il2cpp::os::Thread::RunWrapper(void*)
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/os\Thread.cpp:201:9
#05 0x00000000008c1edc /data/app/com.gravitysketch.gravitysketch-d2c0lU9R7nVvoRQmAot9RQ==/lib/arm64/libil2cpp.so (BuildId: 3ff31b57838c6a4d10d7a59c8dc34eace22ac721)
il2cpp::os::ThreadImpl::ThreadStartWrapper(void*)
C:/SourceTree/GravitySketchVRTest/Build/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/os/Posix\ThreadImpl.cpp:125:9
#06 0x00000000000e68a0 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 21847aa9757f000b0461310a9f5e6e51)
#07 0x0000000000084b6c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 21847aa9757f000b0461310a9f5e6e51)