1

I'm getting this same basic crash report for all the apps I have worked on in swift for our company. It happens a small percentage of the time. There isn't much information to go by. The only line shown from our app is AppDelegate.swift which was not coded by me anyway.

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)

How can I fix the problem?

Brian
  • 105
  • 12
  • You are sending a message to a deallocated object, try enabling zombies in your work scheme. Scheme -> Diagnostics -> Enable Zombie objects. – ohr Nov 22 '16 at 16:07
  • I cannot replicate the crash myself though. It happens only for the users who use the app. – Brian Nov 22 '16 at 16:09

1 Answers1

0

This turned out to be an AVAudioPlayer related problem.. I had a class AVAudioPlayer variable (audioPlay) which I re-initialized over and over for different sounds. Before initializing my variable i stopped the current one and reset it to nil using the below code. Now I don't have the issue anymore.

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