没有太多信息的Swift崩溃报告

时间:2016-11-22 16:05:02

标签: swift crash report exc-bad-access kern-invalid-address

我正在为我公司为swift工作的所有应用程序获得相同的基本崩溃报告。它发生在一小部分时间。没有太多信息可以去。从我们的应用程序显示的唯一一行是AppDelegate.swift,无论如何我都没有编码。

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000739
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libobjc.A.dylib                 0x23353a76 objc_msgSend + 22 (objc-msg-arm.s:418)
1   Foundation                      0x243d56de __NSThreadPerformPerform + 386 (NSThread.m:1235)
2   CoreFoundation                  0x23b6ddfe __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14 (CFRunLoop.c:1761)
3   CoreFoundation                  0x23b6d9ec __CFRunLoopDoSources0 + 452 (CFRunLoop.c:1807)
4   CoreFoundation                  0x23b6bd5a __CFRunLoopRun + 794 (CFRunLoop.c:2536)
5   CoreFoundation                  0x23abb228 CFRunLoopRunSpecific + 520 (CFRunLoop.c:2814)
6   CoreFoundation                  0x23abb014 CFRunLoopRunInMode + 108 (CFRunLoop.c:2844)
7   GraphicsServices                0x250abac8 GSEventRunModal + 160 (GSEvent.c:2245)
8   UIKit                           0x2818f188 UIApplicationMain + 144 (UIApplication.m:3772)
9   ABC Magic 1                     0x001564e4 main + 192 (AppDelegate.swift:13)
10  libdyld.dylib                   0x23763872 start + 2 (start_glue.s:64)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib          0x238382f8 kevent_qos + 24
1   libdispatch.dylib               0x2372dd60 _dispatch_mgr_invoke + 256 (source.c:2542)
2   libdispatch.dylib               0x2372dabe _dispatch_mgr_thread$VARIANT$mp + 38 (source.c:2573)

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib          0x238228d0 mach_msg_trap + 20 (syscall_sw.h:105)
1   libsystem_kernel.dylib          0x238226d4 mach_msg + 40 (mach_msg.c:103)
2   CoreFoundation                  0x23b6dac4 __CFRunLoopServiceMachPort + 136 (CFRunLoop.c:2345)
3   CoreFoundation                  0x23b6be4c __CFRunLoopRun + 1036 (CFRunLoop.c:2607)
4   CoreFoundation                  0x23abb228 CFRunLoopRunSpecific + 520 (CFRunLoop.c:2814)
5   CoreFoundation                  0x23abb014 CFRunLoopRunInMode + 108 (CFRunLoop.c:2844)
6   libAVFAudio.dylib               0x2947a224 GenericRunLoopThread::Entry(void*) + 132 (GenericRunLoopThread.h:102)
7   libAVFAudio.dylib               0x2944f176 CAPThread::Entry(CAPThread*) + 154 (CAPThread.cpp:275)
8   libsystem_pthread.dylib         0x238df85a _pthread_body + 138 (pthread.c:656)
9   libsystem_pthread.dylib         0x238df7ce _pthread_start + 110 (pthread.c:692)
10  libsystem_pthread.dylib         0x238dd724 thread_start + 8 (pthread_asm.s:162)

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib          0x238228d0 mach_msg_trap + 20 (syscall_sw.h:105)
1   libsystem_kernel.dylib          0x238226d4 mach_msg + 40 (mach_msg.c:103)
2   CoreFoundation                  0x23b6dac4 __CFRunLoopServiceMachPort + 136 (CFRunLoop.c:2345)
3   CoreFoundation                  0x23b6be4c __CFRunLoopRun + 1036 (CFRunLoop.c:2607)
4   CoreFoundation                  0x23abb228 CFRunLoopRunSpecific + 520 (CFRunLoop.c:2814)
5   CoreFoundation                  0x23abb014 CFRunLoopRunInMode + 108 (CFRunLoop.c:2844)
6   AudioToolbox                    0x25f2b674 GenericRunLoopThread::Entry(void*) + 132 (GenericRunLoopThread.h:102)
7   AudioToolbox                    0x25f145ae CAPThread::Entry(CAPThread*) + 186 (CAPThread.cpp:275)
8   libsystem_pthread.dylib         0x238df85a _pthread_body + 138 (pthread.c:656)
9   libsystem_pthread.dylib         0x238df7ce _pthread_start + 110 (pthread.c:692)
10  libsystem_pthread.dylib         0x238dd724 thread_start + 8 (pthread_asm.s:162)

Thread 4:
0   libsystem_kernel.dylib          0x23837864 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x238ddb34 _pthread_wqthread + 1036 (pthread.c:1999)
2   libsystem_pthread.dylib         0x238dd718 start_wqthread + 8 (pthread_asm.s:147)

我该如何解决问题?

1 个答案:

答案 0 :(得分:0)

这结果是一个与AVAudioPlayer相关的问题。我有一个类AVAudioPlayer变量(audioPlay),我为了不同的声音反复重新初始化。在初始化我的变量之前,我停止了当前的变量并使用下面的代码将其重置为nil。现在我不再有这个问题了。

if audioPlay != nil
    {
        //print( "blabla" )
        audioPlay?.stop()
        audioPlay = nil
    }