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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
This is a duplicate of issue #1050875