Я включил Address Sanitizer -> Detect use of stack after return
в схеме запуска.Затем я запустил приложение на iPad из Xcode напрямую, и оно заработало.Затем я закрыл приложение, которое завершило сеанс отладки.Затем я запустил приложение, но приложение продолжает падать.Журнал сбоев приведен ниже.
# Crashlytics - plaintext stacktrace downloaded by jsloop at Sat, 23 Feb 2019 11:53:58 GMT
# URL: https://fabric.io/MyApp2/ios/apps/com.MyApp.ios/issues/5c712d4bf8b88c2963d90087?time=last-seven-days/sessions/c5ae974ac57d4de9837d98337449c4a8_DNE_0_v2
# Organization: MyApp
# Platform: ios
# Application: MyApp
# Version: 1.2 (38)
# Bundle Identifier: com.MyApp.ios
# Issue #: 29
# Issue ID: 5c712d4bf8b88c2963d90087
# Session ID: c5ae974ac57d4de9837d98337449c4a8_DNE_0_v2
# Date: 2019-02-23T11:25:00Z
# OS Version: 12.0.0 (16A366)
# Device: iPad 5
# RAM Free: 9.8%
# Disk Free: 69.6%
#6. Crashed: Thread
0 libsystem_kernel.dylib 0x19cda1104 __pthread_kill + 8
1 libsystem_pthread.dylib 0x19ce1c0e0 pthread_kill$VARIANT$mp + 380
2 libsystem_c.dylib 0x19ccf8d78 abort + 140
3 libclang_rt.asan_ios_dynamic.dylib 0x1018111d4 __sanitizer::Abort() + 62
4 libclang_rt.asan_ios_dynamic.dylib 0x10180f9cc __sanitizer::Die() + 174
5 libclang_rt.asan_ios_dynamic.dylib 0x1017f9790 __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 266
6 libclang_rt.asan_ios_dynamic.dylib 0x10180fa54 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 120
7 libclang_rt.asan_ios_dynamic.dylib 0x1017fc370 __asan::AsanThread::SetThreadStackAndTls(__asan::AsanThread::InitOptions const*) + 238
8 libclang_rt.asan_ios_dynamic.dylib 0x1017fbf24 __asan::AsanThread::Init(__asan::AsanThread::InitOptions const*) + 96
9 libclang_rt.asan_ios_dynamic.dylib 0x1017fc394 __asan::AsanThread::ThreadStart(unsigned long long, __sanitizer::atomic_uintptr_t*) + 36
10 libsystem_pthread.dylib 0x19ce252fc _pthread_body + 128
11 libsystem_pthread.dylib 0x19ce2525c _pthread_start + 48
12 libsystem_pthread.dylib 0x19ce28d08 thread_start + 4
--
#0. com.apple.main-thread
0 libsystem_kernel.dylib 0x19cda19fc __ulock_wait + 8
1 libdispatch.dylib 0x19cbe5280 _dispatch_ulock_wait
2 libdispatch.dylib 0x19cbe51ec _dispatch_wait_on_address$VARIANT$mp
3 libdispatch.dylib 0x19cbe5c80 _dispatch_group_wait_slow
4 MyApp 0x100e167a8 CLSContextInitialize + 772
5 MyApp 0x100e139d0 -[CLSCrashReportingController installCrashReportingHandlers:] + 24
6 MyApp 0x100e12cbc -[CLSCrashReportingController startCrashReporterWithAPIKey:betaToken:profilingMark:report:] + 620
7 MyApp 0x100e128bc -[CLSCrashReportingController startWithProfilingMark:betaToken:] + 304
8 MyApp 0x100e06cb0 __20-[Crashlytics start]_block_invoke + 628
9 libdispatch.dylib 0x19cc44484 _dispatch_client_callout
10 libdispatch.dylib 0x19cbe6710 _dispatch_once_callout
11 MyApp 0x100e06a38 -[Crashlytics start] + 156
12 MyApp 0x100e06e5c +[Crashlytics initializeIfNeeded] + 48
13 MyApp 0x100e3c444 __15+[Fabric with:]_block_invoke + 524
14 libdispatch.dylib 0x19cc44484 _dispatch_client_callout
15 libdispatch.dylib 0x19cbe6710 _dispatch_once_callout
16 MyApp 0x100e3c230 +[Fabric with:] + 228
17 MyApp 0x100c7db88 AppDelegate.application(_:didFinishLaunchingWithOptions:) (AppDelegate.swift:23)
18 MyApp 0x100c7e384 @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) (<compiler-generated>)
19 UIKitCore 0x1c98065f8 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
20 UIKitCore 0x1c9807d60 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3340
21 UIKitCore 0x1c980d7ac -[UIApplication _runWithMainScene:transitionContext:completion:] + 1552
22 UIKitCore 0x1ca034db8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784
23 UIKitCore 0x1ca031364 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
24 UIKitCore 0x1ca034a34 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240
25 UIKitCore 0x1ca0353d4 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1076
26 UIKitCore 0x1c9ff45fc __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 772
27 UIKitCore 0x1c9ff42a8 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
28 UIKitCore 0x1ca037844 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
29 UIKitCore 0x1ca038334 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore 0x1ca0376fc -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
31 UIKitCore 0x1ca030a10 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
32 UIKitCore 0x1c980bca4 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
33 UIKitCore 0x1c983d45c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364
34 (Missing) 0x19fc3b890 (Missing)
35 (Missing) 0x19fc46658 (Missing)
36 (Missing) 0x19fc45d50 (Missing)
37 libdispatch.dylib 0x19cc44484 _dispatch_client_callout
38 libdispatch.dylib 0x19cbe7e58 _dispatch_block_invoke_direct$VARIANT$mp
39 (Missing) 0x19fc7a640 (Missing)
40 (Missing) 0x19fc7a2cc (Missing)
41 (Missing) 0x19fc7a8e8 (Missing)
42 CoreFoundation 0x19d19a5b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
43 CoreFoundation 0x19d19a538 __CFRunLoopDoSource0 + 88
44 CoreFoundation 0x19d199e1c __CFRunLoopDoSources0 + 176
45 CoreFoundation 0x19d194ce8 __CFRunLoopRun + 1040
46 CoreFoundation 0x19d1945b8 CFRunLoopRunSpecific + 436
47 (Missing) 0x19f408584 (Missing)
48 UIKitCore 0x1c980f558 UIApplicationMain + 212
49 MyApp 0x100c82880 main (AppDelegate.swift:16)
50 libdyld.dylib 0x19cc54b94 start + 4
#1. com.apple.root.default-qos
0 libsystem_kernel.dylib 0x19cd95fd8 swtch_pri + 8
1 libsystem_pthread.dylib 0x19ce25f88 sched_yield + 16
2 libclang_rt.asan_ios_dynamic.dylib 0x101806c78 __sanitizer::internal_sched_yield() + 12
3 libclang_rt.asan_ios_dynamic.dylib 0x1017e9bb0 wrap_pthread_create + 272
4 MyApp 0x100e08d5c CLSMachExceptionInit + 756
5 libclang_rt.asan_ios_dynamic.dylib 0x1017efdf4 __wrap_dispatch_group_async_block_invoke + 208
6 libdispatch.dylib 0x19cc436c8 _dispatch_call_block_and_release
7 libdispatch.dylib 0x19cc44484 _dispatch_client_callout
8 libdispatch.dylib 0x19cbe75e4 _dispatch_queue_override_invoke
9 libdispatch.dylib 0x19cbf3a60 _dispatch_root_queue_drain
10 libdispatch.dylib 0x19cbf4308 _dispatch_worker_thread2
11 libsystem_pthread.dylib 0x19ce26190 _pthread_wqthread + 472
12 libsystem_pthread.dylib 0x19ce28d00 start_wqthread + 4
#2. Thread
0 libsystem_kernel.dylib 0x19cda1b9c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x19ce261d4 _pthread_wqthread + 540
2 libsystem_pthread.dylib 0x19ce28d00 start_wqthread + 4
#3. Thread
0 libsystem_pthread.dylib 0x19ce28cfc start_wqthread + 190
#4. com.twitter.crashlytics.ios.binary-images
0 libsystem_kernel.dylib 0x19cda3948 write + 8
1 libclang_rt.asan_ios_dynamic.dylib 0x1017c08d4 wrap_write + 108
2 MyApp 0x100e1dcc8 CLSFileLoopWithWriteBlock + 56
3 MyApp 0x100e1df34 CLSFileWriteToFileDescriptorOrBuffer + 212
4 MyApp 0x100e1e334 CLSFileWriteStringWithSuffix + 180
5 MyApp 0x100e1e424 CLSFileWriteHashEntryString + 36
6 MyApp 0x100e052ec __CLSBinaryImageChanged_block_invoke + 176
7 libclang_rt.asan_ios_dynamic.dylib 0x1017efc18 __wrap_dispatch_async_block_invoke + 208
8 libdispatch.dylib 0x19cc436c8 _dispatch_call_block_and_release
9 libdispatch.dylib 0x19cc44484 _dispatch_client_callout
10 libdispatch.dylib 0x19cbebc18 _dispatch_lane_serial_drain$VARIANT$mp
11 libdispatch.dylib 0x19cbec760 _dispatch_lane_invoke$VARIANT$mp
12 libdispatch.dylib 0x19cbf4f00 _dispatch_workloop_worker_thread
13 libsystem_pthread.dylib 0x19ce260f0 _pthread_wqthread + 312
14 libsystem_pthread.dylib 0x19ce28d00 start_wqthread + 4
#5. com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x19cd95ed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x19cd953a8 mach_msg + 72
2 CoreFoundation 0x19d199fb0 __CFRunLoopServiceMachPort + 236
3 CoreFoundation 0x19d194e4c __CFRunLoopRun + 1396
4 CoreFoundation 0x19d1945b8 CFRunLoopRunSpecific + 436
5 Foundation 0x19db886a4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6 Foundation 0x19db88514 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
7 UIKitCore 0x1c976cac0 -[UIEventFetcher threadMain] + 136
8 Foundation 0x19dcbb3b0 __NSThread__start__ + 1040
9 libsystem_pthread.dylib 0x19ce252fc _pthread_body + 128
10 libsystem_pthread.dylib 0x19ce2525c _pthread_start + 48
11 libsystem_pthread.dylib 0x19ce28d08 thread_start + 4
#6. Crashed: Thread
0 libsystem_kernel.dylib 0x19cda1104 __pthread_kill + 8
1 libsystem_pthread.dylib 0x19ce1c0e0 pthread_kill$VARIANT$mp + 380
2 libsystem_c.dylib 0x19ccf8d78 abort + 140
3 libclang_rt.asan_ios_dynamic.dylib 0x1018111d4 __sanitizer::Abort() + 62
4 libclang_rt.asan_ios_dynamic.dylib 0x10180f9cc __sanitizer::Die() + 174
5 libclang_rt.asan_ios_dynamic.dylib 0x1017f9790 __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 266
6 libclang_rt.asan_ios_dynamic.dylib 0x10180fa54 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 120
7 libclang_rt.asan_ios_dynamic.dylib 0x1017fc370 __asan::AsanThread::SetThreadStackAndTls(__asan::AsanThread::InitOptions const*) + 238
8 libclang_rt.asan_ios_dynamic.dylib 0x1017fbf24 __asan::AsanThread::Init(__asan::AsanThread::InitOptions const*) + 96
9 libclang_rt.asan_ios_dynamic.dylib 0x1017fc394 __asan::AsanThread::ThreadStart(unsigned long long, __sanitizer::atomic_uintptr_t*) + 36
10 libsystem_pthread.dylib 0x19ce252fc _pthread_body + 128
11 libsystem_pthread.dylib 0x19ce2525c _pthread_start + 48
12 libsystem_pthread.dylib 0x19ce28d08 thread_start + 4
Полный журнал сбоев с устройства находится по адресу https://pastebin.com/Rwe4QYzH
Что могло послужить причиной того, что средство очистки адресов выдало ошибку AsanCheckFailed
?Когда я отключаю эту опцию, перезапуск приложения работает без сбоев.