0 Replies
      Latest reply on May 13, 2019 1:41 PM by cc412
      cc412 Level 1 Level 1 (0 points)

        I have a very terrible crash problem in my App when I use AVSpeechSynthesizer and I can't repetition it.

         

        Here is my code, It's  a singleton

        - (void)stopSpeech {
            if ([self.synthesizer isPaused]) {
                return;
            }
            if ([self.synthesizer isSpeaking]) {
                BOOL isSpeech = [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
                if (!isSpeech) {
                    [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryWord];
                }
            }
            self.stopBlock ? self.stopBlock() : nil;
        }
        
        
        -(AVSpeechSynthesizer *)synthesizer {
            if (!_synthesizer) {
                _synthesizer = [[AVSpeechSynthesizer alloc] init];
                _synthesizer.delegate = self;
            }
            return _synthesizer;
        }
        
        

         

        When the user leaves the page, I call the stopSpeech method。

         

        Then I got a lot of crash messages

         

        Here is a crash log:

        # Crashlytics - plaintext stacktrace downloaded by liweican at Mon, 13 May 2019 03:03:24 GMT
        # URL: https://fabric.io/youdao-dict/ios/apps/com.youdao.udictionary/issues/5a904ed88cb3c2fa63ad7ed3?time=last-thirty-days/sessions/b1747d91bafc4680ab0ca8e3a702c52c_DNE_0_v2
        # Organization: zzz
        # Platform: ios
        # Application: U-Dictionary
        # Version: 3.0.5.4
        # Bundle Identifier: com.youdao.UDictionary
        # Issue ID: 5a904ed88cb3c2fa63ad7ed3
        # Session ID: b1747d91bafc4680ab0ca8e3a702c52c_DNE_0_v2
        # Date: 2019-05-13T02:27:00Z
        # OS Version: 12.2.0 (16E227)
        # Device: iPhone 8 Plus
        # RAM Free: 17%
        # Disk Free: 64.6%
        
        
        #19. Crashed: AXSpeech
        0  libsystem_pthread.dylib        0x19c15e5b8 pthread_mutex_lock$VARIANT$armv81 + 102
        1  CoreFoundation                 0x19c4cf84c CFRunLoopSourceSignal + 68
        2  Foundation                     0x19cfc7280 performQueueDequeue + 464
        3  Foundation                     0x19cfc680c __NSThreadPerformPerform + 136
        4  CoreFoundation                 0x19c4d22bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
        5  CoreFoundation                 0x19c4d223c __CFRunLoopDoSource0 + 88
        6  CoreFoundation                 0x19c4d1b74 __CFRunLoopDoSources0 + 256
        7  CoreFoundation                 0x19c4cca60 __CFRunLoopRun + 1004
        8  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        9  Foundation                     0x19ce99fcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
        10 libAXSpeechManager.dylib       0x1ac16c94c -[AXSpeechThread main] + 264
        11 Foundation                     0x19cfc66e4 __NSThread__start__ + 984
        12 libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        13 libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        14 libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        --
        
        
        #0. com.apple.main-thread
        0  libsystem_malloc.dylib         0x19c11ce24 small_free_list_remove_ptr_no_clear + 768
        1  libsystem_malloc.dylib         0x19c11f094 small_malloc_from_free_list + 296
        2  libsystem_malloc.dylib         0x19c11f094 small_malloc_from_free_list + 296
        3  libsystem_malloc.dylib         0x19c11d63c small_malloc_should_clear + 224
        4  libsystem_malloc.dylib         0x19c11adcc szone_malloc_should_clear + 132
        5  libsystem_malloc.dylib         0x19c123c18 malloc_zone_malloc + 156
        6  CoreFoundation                 0x19c569ab4 __CFBasicHashRehash + 300
        7  CoreFoundation                 0x19c56b430 __CFBasicHashAddValue + 96
        8  CoreFoundation                 0x19c56ab9c CFBasicHashAddValue + 2160
        9  CoreFoundation                 0x19c49f3bc CFDictionaryAddValue + 260
        10 CoreFoundation                 0x19c572ee8 __54-[CFPrefsSource mergeIntoDictionary:sourceDictionary:]_block_invoke + 28
        11 CoreFoundation                 0x19c49f0b4 __CFDictionaryApplyFunction_block_invoke + 24
        12 CoreFoundation                 0x19c568b7c CFBasicHashApply + 116
        13 CoreFoundation                 0x19c49f090 CFDictionaryApplyFunction + 168
        14 CoreFoundation                 0x19c42f504 -[CFPrefsSource mergeIntoDictionary:sourceDictionary:] + 136
        15 CoreFoundation                 0x19c4bcd38 -[CFPrefsSearchListSource alreadylocked_getDictionary:] + 644
        16 CoreFoundation                 0x19c42e71c -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 152
        17 CoreFoundation                 0x19c42e660 -[CFPrefsSource copyValueForKey:] + 60
        18 CoreFoundation                 0x19c579e88 __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 40
        19 CoreFoundation                 0x19c4bdff4 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 272
        20 CoreFoundation                 0x19c4bda38 normalizeQuintuplet + 340
        21 CoreFoundation                 0x19c42c634 -[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 108
        22 CoreFoundation                 0x19c42cec0 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 148
        23 CoreFoundation                 0x19c57c2d0 _CFPreferencesCopyAppValueWithContainerAndConfiguration + 124
        24 TextInput                      0x1a450e550 -[TIPreferencesController valueForPreferenceKey:] + 460
        25 UIKitCore                      0x1c87c71f8 -[UIKeyboardPreferencesController handBias] + 36
        26 UIKitCore                      0x1c887275c -[UIKeyboardLayoutStar showKeyboardWithInputTraits:screenTraits:splitTraits:] + 320
        27 UIKitCore                      0x1c88f4240 -[UIKeyboardImpl finishLayoutChangeWithArguments:] + 492
        28 UIKitCore                      0x1c88f47c8 -[UIKeyboardImpl updateLayout] + 1208
        29 UIKitCore                      0x1c88eaad0 -[UIKeyboardImpl updateLayoutIfNecessary] + 448
        30 UIKitCore                      0x1c88eab9c -[UIKeyboardImpl setFrame:] + 140
        31 UIKitCore                      0x1c88d5d60 -[UIKeyboard activate] + 652
        32 UIKitCore                      0x1c894c90c -[UIKeyboardAutomatic activate] + 128
        33 UIKitCore                      0x1c88d5158 -[UIKeyboard setFrame:] + 296
        34 UIKitCore                      0x1c88d81b0 -[UIKeyboard _didChangeKeyplaneWithContext:] + 228
        35 UIKitCore                      0x1c88f4aa0 -[UIKeyboardImpl didMoveToSuperview] + 136
        36 UIKitCore                      0x1c8f2ad84 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 888
        37 UIKitCore                      0x1c8f2a970 -[UIView(Hierarchy) _postMovedFromSuperview:] + 760
        38 UIKitCore                      0x1c8f39ddc -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1740
        39 UIKitCore                      0x1c88d5d84 -[UIKeyboard activate] + 688
        40 UIKitCore                      0x1c894c90c -[UIKeyboardAutomatic activate] + 128
        41 UIKitCore                      0x1c893b3a4 -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 1332
        42 UIKitCore                      0x1c8ae66d8 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 80
        43 UIKitCore                      0x1c8ae23bc -[UIResponder becomeFirstResponder] + 804
        44 UIKitCore                      0x1c8f2a560 -[UIView(Hierarchy) becomeFirstResponder] + 156
        45 UIKitCore                      0x1c8d93e84 -[UITextField becomeFirstResponder] + 244
        46 UIKitCore                      0x1c8d578dc -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 192
        47 UIKitCore                      0x1c8d45d8c -[UITextSelectionInteraction oneFingerTap:] + 3136
        48 UIKitCore                      0x1c86e0bcc -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64
        49 UIKitCore                      0x1c86e8dd4 _UIGestureRecognizerSendTargetActions + 124
        50 UIKitCore                      0x1c86e6778 _UIGestureRecognizerSendActions + 316
        51 UIKitCore                      0x1c86e5ca4 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 760
        52 UIKitCore                      0x1c86d9d80 _UIGestureEnvironmentUpdate + 2180
        53 UIKitCore                      0x1c86d94b0 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 384
        54 UIKitCore                      0x1c86d9290 -[UIGestureEnvironment _updateForEvent:window:] + 204
        55 UIKitCore                      0x1c8af14a8 -[UIWindow sendEvent:] + 3112
        56 UIKitCore                      0x1c8ad1534 -[UIApplication sendEvent:] + 340
        57 UIKitCore                      0x1c8b977c0 __dispatchPreprocessedEventFromEventQueue + 1768
        58 UIKitCore                      0x1c8b99eec __handleEventQueueInternal + 4828
        59 UIKitCore                      0x1c8b9311c __handleHIDEventFetcherDrain + 152
        60 CoreFoundation                 0x19c4d22bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
        61 CoreFoundation                 0x19c4d223c __CFRunLoopDoSource0 + 88
        62 CoreFoundation                 0x19c4d1b24 __CFRunLoopDoSources0 + 176
        63 CoreFoundation                 0x19c4cca60 __CFRunLoopRun + 1004
        64 CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        65 GraphicsServices               0x19e6cc79c GSEventRunModal + 104
        66 UIKitCore                      0x1c8ab7b68 UIApplicationMain + 212
        67 UDictionary                    0x10517e138 main (main.m:17)
        68 libdyld.dylib                  0x19bf928e0 start + 4
        
        
        #1. Thread
        0  libsystem_kernel.dylib         0x19c0deb74 __workq_kernreturn + 8
        1  libsystem_pthread.dylib        0x19c161138 _pthread_wqthread + 340
        2  libsystem_pthread.dylib        0x19c163cd4 start_wqthread + 4
        
        
        #2. com.apple.uikit.eventfetch-thread
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  Foundation                     0x19ce99fcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
        6  Foundation                     0x19ce99e5c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
        7  UIKitCore                      0x1c8b9d540 -[UIEventFetcher threadMain] + 136
        8  Foundation                     0x19cfc66e4 __NSThread__start__ + 984
        9  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        10 libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        11 libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #3. JavaScriptCore bmalloc scavenger
        0  libsystem_kernel.dylib         0x19c0ddee4 __psynch_cvwait + 8
        1  libsystem_pthread.dylib        0x19c15d4a4 _pthread_cond_wait$VARIANT$armv81 + 628
        2  libc++.1.dylib                 0x19b6b5090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
        3  JavaScriptCore                 0x1a36a2238 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
        4  JavaScriptCore                 0x1a36a622c bmalloc::Scavenger::threadRunLoop() + 176
        5  JavaScriptCore                 0x1a36a59a4 bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
        6  JavaScriptCore                 0x1a36a73e4 std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
        7  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        8  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        9  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #4. WebThread
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  WebCore                        0x1a5126480 RunWebThread(void*) + 600
        6  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        7  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        8  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #5. com.twitter.crashlytics.ios.MachExceptionServer
        0  UDictionary                    0x1058a5564 CLSProcessRecordAllThreads (CLSProcess.c:376)
        1  UDictionary                    0x1058a594c CLSProcessRecordAllThreads (CLSProcess.c:407)
        2  UDictionary                    0x1058952dc CLSHandler (CLSHandler.m:26)
        3  UDictionary                    0x1058906cc CLSMachExceptionServer (CLSMachException.c:446)
        4  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        5  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        6  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #6. com.apple.NSURLConnectionLoader
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  CFNetwork                      0x19cae574c -[__CoreSchedulingSetRunnable runForever] + 216
        6  Foundation                     0x19cfc66e4 __NSThread__start__ + 984
        7  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        8  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        9  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #7. AVAudioSession Notify Thread
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  AVFAudio                       0x1a238a378 GenericRunLoopThread::Entry(void*) + 156
        6  AVFAudio                       0x1a23b4c60 CAPThread::Entry(CAPThread*) + 88
        7  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        8  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        9  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #8. WebCore: LocalStorage
        0  libsystem_kernel.dylib         0x19c0ddee4 __psynch_cvwait + 8
        1  libsystem_pthread.dylib        0x19c15d4a4 _pthread_cond_wait$VARIANT$armv81 + 628
        2  JavaScriptCore                 0x1a3668ce4 ***::ThreadCondition::timedWait(***::Mutex&, ***::WallTime) + 80
        3  JavaScriptCore                 0x1a364f96c ***::ParkingLot::parkConditionallyImpl(void const*, ***::ScopedLambda<bool ()> const&, ***::ScopedLambda<void ()> const&, ***::TimeWithDynamicClockType const&) + 2004
        4  WebKitLegacy                   0x1a67b6ea8 bool ***::Condition::waitUntil<***::Lock>(***::Lock&, ***::TimeWithDynamicClockType const&) + 184
        5  WebKitLegacy                   0x1a67b9ba4 std::__1::unique_ptr<***::Function<void ()>, std::__1::default_delete<***::Function<void ()> > > ***::MessageQueue<***::Function<void ()> >::waitForMessageFilteredWithTimeout<***::MessageQueue<***::Function<void ()> >::waitForMessage()::'lambda'(***::Function<void ()> const&)>(***::MessageQueueWaitResult&, ***::MessageQueue<***::Function<void ()> >::waitForMessage()::'lambda'(***::Function<void ()> const&)&&, ***::WallTime) + 156
        6  WebKitLegacy                   0x1a67b91c0 WebCore::StorageThread::threadEntryPoint() + 68
        7  JavaScriptCore                 0x1a3666f88 ***::Thread::entryPoint(***::Thread::NewThreadContext*) + 260
        8  JavaScriptCore                 0x1a3668494 ***::wtfThreadEntryPoint(void*) + 12
        9  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        10 libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        11 libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #9. com.apple.CoreMotion.MotionThread
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  CoreFoundation                 0x19c4cd0b0 CFRunLoopRun + 80
        6  CoreMotion                     0x1a1df0240 (Missing)
        7  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        8  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        9  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #10. Thread
        0  libsystem_kernel.dylib         0x19c0deb74 __workq_kernreturn + 8
        1  libsystem_pthread.dylib        0x19c161138 _pthread_wqthread + 340
        2  libsystem_pthread.dylib        0x19c163cd4 start_wqthread + 4
        
        
        #11. Thread
        0  libsystem_kernel.dylib         0x19c0deb74 __workq_kernreturn + 8
        1  libsystem_pthread.dylib        0x19c1611f8 _pthread_wqthread + 532
        2  libsystem_pthread.dylib        0x19c163cd4 start_wqthread + 4
        
        
        #12. com.apple.CFStream.LegacyThread
        0  libsystem_kernel.dylib         0x19c0d30f4 mach_msg_trap + 8
        1  libsystem_kernel.dylib         0x19c0d25a0 mach_msg + 72
        2  CoreFoundation                 0x19c4d1cb4 __CFRunLoopServiceMachPort + 236
        3  CoreFoundation                 0x19c4ccbc4 __CFRunLoopRun + 1360
        4  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        5  CoreFoundation                 0x19c4e5094 _legacyStreamRunLoop_workThread + 260
        6  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        7  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        8  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #13. Thread
        0  libsystem_pthread.dylib        0x19c163cd0 start_wqthread + 190
        
        
        #14. Thread
        0  libsystem_kernel.dylib         0x19c0deb74 __workq_kernreturn + 8
        1  libsystem_pthread.dylib        0x19c161138 _pthread_wqthread + 340
        2  libsystem_pthread.dylib        0x19c163cd4 start_wqthread + 4
        
        
        #15. Thread
        0  libsystem_kernel.dylib         0x19c0deb74 __workq_kernreturn + 8
        1  libsystem_pthread.dylib        0x19c161138 _pthread_wqthread + 340
        2  libsystem_pthread.dylib        0x19c163cd4 start_wqthread + 4
        
        
        #16. Thread
        0  libsystem_kernel.dylib         0x19c0d3148 semaphore_timedwait_trap + 8
        1  libdispatch.dylib              0x19bf50a4c _dispatch_sema4_timedwait$VARIANT$armv81 + 64
        2  libdispatch.dylib              0x19bf513a8 _dispatch_semaphore_wait_slow + 72
        3  libdispatch.dylib              0x19bf647c8 _dispatch_worker_thread + 344
        4  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        5  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        6  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #17. Thread
        0  libsystem_kernel.dylib         0x19c0d3148 semaphore_timedwait_trap + 8
        1  libdispatch.dylib              0x19bf50a4c _dispatch_sema4_timedwait$VARIANT$armv81 + 64
        2  libdispatch.dylib              0x19bf513a8 _dispatch_semaphore_wait_slow + 72
        3  libdispatch.dylib              0x19bf647c8 _dispatch_worker_thread + 344
        4  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        5  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        6  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #18. Thread
        0  libsystem_kernel.dylib         0x19c0d3148 semaphore_timedwait_trap + 8
        1  libdispatch.dylib              0x19bf50a4c _dispatch_sema4_timedwait$VARIANT$armv81 + 64
        2  libdispatch.dylib              0x19bf513a8 _dispatch_semaphore_wait_slow + 72
        3  libdispatch.dylib              0x19bf647c8 _dispatch_worker_thread + 344
        4  libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        5  libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        6  libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #19. Crashed: AXSpeech
        0  libsystem_pthread.dylib        0x19c15e5b8 pthread_mutex_lock$VARIANT$armv81 + 102
        1  CoreFoundation                 0x19c4cf84c CFRunLoopSourceSignal + 68
        2  Foundation                     0x19cfc7280 performQueueDequeue + 464
        3  Foundation                     0x19cfc680c __NSThreadPerformPerform + 136
        4  CoreFoundation                 0x19c4d22bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
        5  CoreFoundation                 0x19c4d223c __CFRunLoopDoSource0 + 88
        6  CoreFoundation                 0x19c4d1b74 __CFRunLoopDoSources0 + 256
        7  CoreFoundation                 0x19c4cca60 __CFRunLoopRun + 1004
        8  CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        9  Foundation                     0x19ce99fcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
        10 libAXSpeechManager.dylib       0x1ac16c94c -[AXSpeechThread main] + 264
        11 Foundation                     0x19cfc66e4 __NSThread__start__ + 984
        12 libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        13 libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        14 libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        
        #20. AXSpeech
        0  (Missing)                      0x1071ba524 (Missing)
        1  (Missing)                      0x1071b3e7c (Missing)
        2  (Missing)                      0x10718fba4 (Missing)
        3  (Missing)                      0x107184bc8 (Missing)
        4  libdyld.dylib                  0x19bf95908 dlopen + 176
        5  CoreFoundation                 0x19c5483e8 _CFBundleDlfcnLoadBundle + 140
        6  CoreFoundation                 0x19c486918 _CFBundleLoadExecutableAndReturnError + 352
        7  Foundation                     0x19ced5734 -[NSBundle loadAndReturnError:] + 428
        8  TextToSpeech                   0x1abfff800 TTSSpeechUnitTestingMode + 1020
        9  libdispatch.dylib              0x19bf817d4 _dispatch_client_callout + 16
        10 libdispatch.dylib              0x19bf52040 _dispatch_once_callout + 28
        11 TextToSpeech                   0x1abfff478 TTSSpeechUnitTestingMode + 116
        12 libobjc.A.dylib                0x19b7173cc CALLING_SOME_+initialize_METHOD + 24
        13 libobjc.A.dylib                0x19b71cee0 initializeNonMetaClass + 296
        14 libobjc.A.dylib                0x19b71e640 initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt<false>&, bool) + 260
        15 libobjc.A.dylib                0x19b7265a4 lookUpImpOrForward + 244
        16 libobjc.A.dylib                0x19b733858 _objc_msgSend_uncached + 56
        17 libAXSpeechManager.dylib       0x1ac167324 -[AXSpeechManager _initialize] + 68
        18 Foundation                     0x19cfc68d4 __NSThreadPerformPerform + 336
        19 CoreFoundation                 0x19c4d22bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
        20 CoreFoundation                 0x19c4d223c __CFRunLoopDoSource0 + 88
        21 CoreFoundation                 0x19c4d1b74 __CFRunLoopDoSources0 + 256
        22 CoreFoundation                 0x19c4cca60 __CFRunLoopRun + 1004
        23 CoreFoundation                 0x19c4cc354 CFRunLoopRunSpecific + 436
        24 Foundation                     0x19ce99fcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
        25 libAXSpeechManager.dylib       0x1ac16c94c -[AXSpeechThread main] + 264
        26 Foundation                     0x19cfc66e4 __NSThread__start__ + 984
        27 libsystem_pthread.dylib        0x19c1602c0 _pthread_body + 128
        28 libsystem_pthread.dylib        0x19c160220 _pthread_start + 44
        29 libsystem_pthread.dylib        0x19c163cdc thread_start + 4
        
        

         

         

        I change my code like this, It still has the same problem

         

        - (void)stopSpeech {
            if (self.synthesizer != nil && [self.synthesizer isPaused]) {
                return;
            }
        //    if ([self.synthesizer isSpeaking]) {
        //        BOOL isSpeech = [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
        //        if (!isSpeech) {
        //            [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryWord];
        //        }
        //    }
            if (self.synthesizer != nil) {
                [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
        //        if (!isSpeech) {
        //           [self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryWord];
        //        }
                self.stopBlock ? self.stopBlock() : nil;
            }
        }