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
- Emissive Mesh emissiveness does not change when the Area Light intensity is animated through script
- No error notification is displayed when creating a tag with an already existing name
- Scripting API Manual Page's layout is broken when using Unity 6 manual version or above
- [Android] [iOS] Popping/crackling sound occurs when the app is repeatedly brought to the background and foreground while the sound is playing
- UI Builder unloads UXML file and discards any unsaved changes when entering Play Mode with Domain and Scene Reload enabled
This is a duplicate of issue #1050875