Search Issue Tracker
Duplicate
Fixed in 2017.4.X, 2018.2.X
Votes
0
Found in
Issue ID
1094478
Regression
No
iPhone XS Crash When Spawning C++ Thread
Steps to reproduce:
- Export a unity project to iPhone
- Create a C++ thread as such and wait for it to finish executing
- Crash on iPhone XS
Crash sample projects:
https://ufile.io/e8m26
void *reproduce_crash()
{
pthread_setname_np("CrashingThread");
}
call
std::thread(reproduce_crash).detach()
from anywhere. After thread executes it crashes upon cleanup.
The issue only happens on iPhone XS and only when using C++ constructs to spawn a thread, if you use the C pthread functions directly then the crash does not occur.
Its not an iOS 12 or iPhone XS issue since if you create an empty app on Xcode and do these same steps the crash does not occur. It only happens when unity is somehow linked.
If you open the attached samples you will see that the crash only happens with unity.
0 libsystem_c.dylib 0x000000022d4c7094 __abort + 188
1 libsystem_c.dylib 0x000000022d4c6fd8 __abort + 0
2 libsystem_malloc.dylib 0x000000022d5c3c7c _malloc_put + 0
3 libsystem_malloc.dylib 0x000000022d5c3e48 malloc_report + 68
4 libsystem_malloc.dylib 0x000000022d5b5574 free + 412
5 libsystem_pthread.dylib 0x000000022d5ed40c _pthread_tsd_cleanup + 512
6 libsystem_pthread.dylib 0x000000022d5e6cc8 _pthread_exit + 84
7 libsystem_pthread.dylib 0x000000022d5e5a10 _pthread_body + 144
8 libsystem_pthread.dylib 0x000000022d5e5960 _pthread_start + 52
9 libsystem_pthread.dylib 0x000000022d5eddf4 thread_start + 4
The crash always happens on pthread_tsd_cleanup and only on iPhone XS and iPhone XS Max.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
- A memory leak occurs in Play mode when using Direct3D12 Graphics API
This is a duplicate of issue #1050875