To check the existence of any threading issue I tried using Thread Sanitiser
. But upon enabling it in Edit Scheme my app is crashing as soon as I launch the app. Below is the stack backtrace.
* thread #1, stop reason = signal SIGABRT
* frame #0: 0x0000000117791ad6 libsystem_kernel.dylib`__abort_with_payload + 10
frame #1: 0x00000001177933df libsystem_kernel.dylib`abort_with_payload_wrapper_internal + 80
frame #2: 0x000000011779338f libsystem_kernel.dylib`abort_with_reason + 19
frame #3: 0x00000001177d8c29 libsystem_pthread.dylib`pthread_self.cold.1 + 24
frame #4: 0x00000001177d2334 libsystem_pthread.dylib`pthread_self + 35
frame #5: 0x000000010ea1516b libclang_rt.tsan_iossim_dynamic.dylib`__tsan::cur_thread() + 11
frame #6: 0x000000010e9ea985 libclang_rt.tsan_iossim_dynamic.dylib`wrap_sysctlbyname + 37
frame #7: 0x00000001176bd390 libsystem_sim_kernel.dylib`assert_simulator_supported_host + 44
frame #8: 0x0000000116301a0c libSystem.B.dylib`libSystem_initializer + 56
frame #9: 0x000000010e928f14 dyld_sim`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 518
frame #10: 0x000000010e929112 dyld_sim`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
frame #11: 0x000000010e924547 dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 343
frame #12: 0x000000010e9244d3 dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 227
frame #13: 0x000000010e9244d3 dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 227
frame #14: 0x000000010e9244d3 dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 227
frame #15: 0x000000010e923704 dyld_sim`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 134
frame #16: 0x000000010e923798 dyld_sim`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 74
frame #17: 0x000000010e917342 dyld_sim`dyld::initializeMainExecutable() + 129
frame #18: 0x000000010e91b497 dyld_sim`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 4395
frame #19: 0x000000010e916624 dyld_sim`start_sim + 136
frame #20: 0x000000011092879a dyld`dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) + 2308
frame #21: 0x0000000110926432 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 837
frame #22: 0x0000000110921227 dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 453
frame #23: 0x0000000110921025 dyld`_dyld_start + 37
I also tried changing Strip Style
from All Symbols to Debugging Symbols but no avail. Any suggestion in this regard will be helpful. Thanks.
Which Xcode version are you using? Because in Release Notes of Xcode 11.3.1 you can find a fix for the Thread Sanitizer.
Resolved an issue that prevented Xcode from launching processes with Thread Sanitizer enabled on macOS Catalina 10.15.2. (57822138)