当我在 Xcode 版本 11.3 (11C29) 中创建一个新的单视图应用程序并运行它时,一切正常。
当我打开 Thread Sanitize
并尝试运行相同的应用程序,我得到Thread 1: signal SIGABRT
这是回溯
(lldb) bt
* thread #1, stop reason = signal SIGABRT
* frame #0: 0x00007fff523d5bea libsystem_kernel.dylib`__abort_with_payload + 10
frame #1: 0x00007fff523d74f3 libsystem_kernel.dylib`abort_with_payload_wrapper_internal + 80
frame #2: 0x00007fff523d74a3 libsystem_kernel.dylib`abort_with_reason + 19
frame #3: 0x00007fff52469974 libsystem_pthread.dylib`pthread_self.cold.1 + 24
frame #4: 0x00007fff52462fe3 libsystem_pthread.dylib`pthread_self + 34
frame #5: 0x0000000105f2316b libclang_rt.tsan_iossim_dynamic.dylib`__tsan::cur_thread() + 11
frame #6: 0x0000000105ef8985 libclang_rt.tsan_iossim_dynamic.dylib`wrap_sysctlbyname + 37
frame #7: 0x00007fff52470331 libsystem_sim_kernel.dylib`assert_simulator_supported_host + 44
frame #8: 0x00007fff4ff167c1 libSystem.B.dylib`libSystem_initializer + 78
frame #9: 0x0000000105e2a3a7 dyld_sim`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 517
frame #10: 0x0000000105e2a7b8 dyld_sim`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
frame #11: 0x0000000105e259a2 dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 456
frame #12: 0x0000000105e2590f dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 309
frame #13: 0x0000000105e2590f dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 309
frame #14: 0x0000000105e2590f dyld_sim`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 309
frame #15: 0x0000000105e247a6 dyld_sim`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 188
frame #16: 0x0000000105e24846 dyld_sim`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 82
frame #17: 0x0000000105e19046 dyld_sim`dyld::initializeMainExecutable() + 129
frame #18: 0x0000000105e1d0fc dyld_sim`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 3831
frame #19: 0x0000000105e181cd dyld_sim`start_sim + 122
frame #20: 0x000000010e7f68cc dyld`dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) + 2308
frame #21: 0x000000010e7f4575 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 818
frame #22: 0x000000010e7ef227 dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 453
frame #23: 0x000000010e7ef025 dyld`_dyld_start + 37
(lldb)
我错过了一些东西或错误地使用了 Thread Sanitizer。
编辑:我在 ID 为 FB7513235 的反馈助手中打开了 Apple 的问题。我在反馈助手中打开的工单表明存在类似的报告问题。