Search Unity

IOS 12 Crash - AudioToolbox

Discussion in 'iOS and tvOS' started by Fesener, Jul 31, 2019.

  1. Fesener

    Fesener

    Joined:
    May 3, 2018
    Posts:
    33
    Hi,

    This crash is only happening on iOS 12 devices, couldn't manage to reproduce. Occurring in both 2017.4 and 2018.4 LTS versions

    Code (CSharp):
    1. Crashed: AVAudioSession Notify Thread
    2. 0  AudioToolbox                   0x195bc611c InterruptionListener(void*, unsigned int, unsigned int, void const*) + 240
    3. 1  AudioToolbox                   0x195c663e4 AudioSessionPropertyListeners::CallPropertyListenersImp(AudioSessionPropertyListeners const&, unsigned int, unsigned int, void const*) + 748
    4. 2  AudioToolbox                   0x195d5c100 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 220
    5. 3  AudioToolbox                   0x195d9ec60 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 824
    6. 4  AudioToolbox                   0x195d9da10 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 568
    7. 5  AudioToolbox                   0x195d9d4e4 ASCallbackReceiver_AudioSessionPingMessage + 588
    8. 6  AudioToolbox                   0x195c56ec0 _XAudioSessionPingMessage + 52
    9. 7  AudioToolbox                   0x195f9e1a8 mshMIGPerform + 232
    10. 8  CoreFoundation                 0x191c9f690 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    11. 9  CoreFoundation                 0x191c9eddc __CFRunLoopDoSource1 + 440
    12. 10 CoreFoundation                 0x191c99c00 __CFRunLoopRun + 2096
    13. 11 CoreFoundation                 0x191c990b0 CFRunLoopRunSpecific + 436
    14. 12 AVFAudio                       0x197b81334 GenericRunLoopThread::Entry(void*) + 156
    15. 13 AVFAudio                       0x197babc60 CAPThread::Entry(CAPThread*) + 88
    16. 14 libsystem_pthread.dylib        0x19192c2c0 _pthread_body + 128
    17. 15 libsystem_pthread.dylib        0x19192c220 _pthread_start + 44
    18. 16 libsystem_pthread.dylib        0x19192fcdc thread_start + 4
    Anyone else experiencing the same problem?
     
    Last edited: Jul 31, 2019
    piticli likes this.
  2. zyf2533

    zyf2533

    Joined:
    Mar 11, 2019
    Posts:
    1
    I have the same problem,some can help?
     
  3. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    Hello @Fesener, could you create a bug report with a minimalistic project that showcases the issue and reply the bug ID here?
     
  4. Fesener

    Fesener

    Joined:
    May 3, 2018
    Posts:
    33
    Hi,

    Sadly I haven't managed to reproduce this exception myself and it's happening on a fairly large project so not sure which part causing this problem as well.
     
  5. nukeustwo

    nukeustwo

    Joined:
    Sep 4, 2015
    Posts:
    51
    We're actually seeing something similar in our release game that is on 2018.4.7f1 @AurimasA

    Code (CSharp):
    1. Thread 26 name:
    2. Thread 26 Crashed:
    3. 0   libEmbeddedSystemAUs.dylib        0x00000001a0106074 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 304 (AURemoteIO.cpp:257)
    4. 1   libEmbeddedSystemAUs.dylib        0x00000001a0105fd8 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148 (AURemoteIO.cpp:256)
    5. 2   AudioToolbox                      0x000000018d585850 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 556 (AudioSessionPropertyListeners.cpp:146)
    6. 3   AudioToolbox                      0x000000018d5d451c HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1012 (AudioSession.cpp:932)
    7. 4   AudioToolbox                      0x000000018d5d3da8 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2172 (AudioSession.cpp:1050)
    8. 5   AudioToolbox                      0x000000018d637700 _XAudioSessionPingMessage + 640 (AudioSession.cpp:1161)
    9. 6   libAudioToolboxUtility.dylib      0x000000018d6ac6c4 mshMIGPerform + 268 (MachServerHelper.c:450)
    10. 7   CoreFoundation                    0x00000001822c991c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1937)
    11. 8   CoreFoundation                    0x00000001822c8fe8 __CFRunLoopDoSource1 + 448 (CFRunLoop.c:2075)
    12. 9   CoreFoundation                    0x00000001822c3c20 __CFRunLoopRun + 2144 (CFRunLoop.c:3098)
    13. 10  CoreFoundation                    0x00000001822c3098 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
    14. 11  AVFAudio                          0x000000018f07b280 GenericRunLoopThread::Entry(void*) + 160 (GenericRunLoopThread.h:91)
    15. 12  AVFAudio                          0x000000018f0cc28c CAPThread::Entry(CAPThread*) + 208 (CAPThread.cpp:286)
    16. 13  libsystem_pthread.dylib           0x0000000182058d5c _pthread_start + 128 (pthread.c:895)
    17. 14  libsystem_pthread.dylib           0x0000000182060c84 thread_start + 8
     
    Last edited: Sep 20, 2019
  6. jeremy_gram

    jeremy_gram

    Joined:
    Jun 21, 2018
    Posts:
    14
    Same here in Unity 2018.4.11f1:
    Code (CSharp):
    1. Thread 29 (crashed)
    2. 0   libEmbeddedSystemAUs.dylib         0x00000001b6ff014c InterruptionListener(void*, unsigned int, unsigned int, void const*)
    3. 1   AudioToolbox                       0x00000001a4736990 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*)
    4. 2   AudioToolbox                       0x00000001a4793390 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int)
    5. 3   AudioToolbox                       0x00000001a47929c8 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int)
    6. 4   AudioToolbox                       0x00000001a4791d58 ASCallbackReceiver_AudioSessionPingMessage
    7. 5   AudioToolbox                       0x00000001a47fdf08 _XAudioSessionPingMessage
    8. 6   libAudioToolboxUtility.dylib       0x00000001a4890298 mshMIGPerform
    9. 7   CoreFoundation                     0x00000001997a2e5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
    10. 8   CoreFoundation                     0x00000001997a2588 __CFRunLoopDoSource1
    11. 9   CoreFoundation                     0x000000019979d45c __CFRunLoopRun
    12. 10  CoreFoundation                     0x000000019979c8bc CFRunLoopRunSpecific
    13. 11  AVFAudio                           0x00000001a61fde68 GenericRunLoopThread::Entry(void*)
    14. 12  AVFAudio                           0x00000001a624edf0 CAPThread::Entry(CAPThread*)
    15. 13  libsystem_pthread.dylib            0x00000001995411ec _pthread_start
    16. 14  libsystem_pthread.dylib            0x0000000199544aec thread_start
     
  7. jeremy_gram

    jeremy_gram

    Joined:
    Jun 21, 2018
    Posts:
    14
    Also happens on iOS 13:
    Code (CSharp):
    1. Crashed: AVAudioSession Notify Thread
    2. 0  libEmbeddedSystemAUs.dylib      0x1c354014c InterruptionListener(void*, unsigned int, unsigned int, void const*) + 352
    3. 1  libEmbeddedSystemAUs.dylib      0x1c3540080 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148
    4. 2  AudioToolbox                    0x1b0af4758 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
    5. 3  AudioToolbox                    0x1b0b513e0 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
    6. 4  AudioToolbox                    0x1b0b50a18 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2240
    7. 5  AudioToolbox                    0x1b0b4fda8 ASCallbackReceiver_AudioSessionPingMessage + 636
    8. 6  AudioToolbox                    0x1b0bbbe18 _XAudioSessionPingMessage + 44
    9. 7  libAudioToolboxUtility.dylib    0x1b0c4e298 mshMIGPerform + 264
    10. 8  CoreFoundation                  0x1a5a5fe40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    11. 9  CoreFoundation                  0x1a5a5f56c __CFRunLoopDoSource1 + 444
    12. 10 CoreFoundation                  0x1a5a5a440 __CFRunLoopRun + 2168
    13. 11 CoreFoundation                  0x1a5a598a0 CFRunLoopRunSpecific + 464
    14. 12 AVFAudio                        0x1b25e7c1c GenericRunLoopThread::Entry(void*) + 156
    15. 13 AVFAudio                        0x1b2638d60 CAPThread::Entry(CAPThread*) + 204
    16. 14 libsystem_pthread.dylib         0x1a57fe1d0 _pthread_start + 124
    17. 15 libsystem_pthread.dylib         0x1a5801ae0 thread_start + 8
     
  8. MattherHain

    MattherHain

    Joined:
    Nov 10, 2017
    Posts:
    15
    Also, it happens to my game.

    Crashed: AVAudioSession Notify Thread
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000000001b0

    Crashed: AVAudioSession Notify Thread
    0 libEmbeddedSystemAUs.dylib 0x19e2d314c InterruptionListener(void*, unsigned int, unsigned int, void const*) + 352
    1 libEmbeddedSystemAUs.dylib 0x19e2d3080 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148
    2 AudioToolbox 0x18ba19990 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
    3 AudioToolbox 0x18ba76390 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
    4 AudioToolbox 0x18ba759c8 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2240
    5 AudioToolbox 0x18ba74d58 ASCallbackReceiver_AudioSessionPingMessage + 636
    6 AudioToolbox 0x18bae0f08 _XAudioSessionPingMessage + 44
    7 libAudioToolboxUtility.dylib 0x18bb73298 mshMIGPerform + 264
    8 CoreFoundation 0x180a86e5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    9 CoreFoundation 0x180a86588 __CFRunLoopDoSource1 + 444
    10 CoreFoundation 0x180a8145c __CFRunLoopRun + 2168
    11 CoreFoundation 0x180a808bc CFRunLoopRunSpecific + 464
    12 AVFAudio 0x18d4e0e68 GenericRunLoopThread::Entry(void*) + 156
    13 AVFAudio 0x18d531df0 CAPThread::Entry(CAPThread*) + 204
    14 libsystem_pthread.dylib 0x1808251ec _pthread_start + 124
    15 libsystem_pthread.dylib 0x180828aec thread_start + 8
     
  9. Sendish

    Sendish

    Joined:
    Nov 11, 2019
    Posts:
    1
    Is there any update on this issue, we get a lot of crash on iOS12 & iOS13.
     
  10. phuongnh

    phuongnh

    Joined:
    Sep 23, 2019
    Posts:
    22
    Same here with Unity 2018.4.12f1, anything new?
     
  11. chrisvasselli

    chrisvasselli

    Joined:
    Jul 11, 2012
    Posts:
    2
    I'm also seeing this issue, Unity 2019.2.17f1.
     
  12. potato_based_username

    potato_based_username

    Joined:
    Jul 25, 2018
    Posts:
    2
    We are now seeing this all of a sudden on our 2018.4.13f1 builds as well. Anyone know a workaround?
     
  13. magnusfox

    magnusfox

    Joined:
    Nov 7, 2014
    Posts:
    26
    Also confirmed in Unity 2019.2.5f1, on iOS 13.3
     
  14. phuongnh

    phuongnh

    Joined:
    Sep 23, 2019
    Posts:
    22
    upload_2020-2-4_18-50-53.png

    FYI: last 7 days crash report of my game.
     
  15. sheehanm

    sheehanm

    Joined:
    Jan 11, 2019
    Posts:
    3
    Also confirmed in Unity 2019.1.1f1
    iPad7,5 iPhone OS 12.3.1 (16F203)
    iPad7,5 iPhone OS 12.4.1 (16G102)
    iPad6,11 iPhone OS 12.4.1 (16G102)
    iPad4,4 iPhone OS 12.4.4 (16G140)

    All the crash logs have the same thing:
    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Subtype: KERN_INVALID_ADDRESS at <some_address>
    VM Region Info: <some_address> is not in any region.

    Code (CSharp):
    1. Thread 6 name:
    2. Thread 6 Crashed:
    3. 0   AudioToolbox                      0x000000022942610c InterruptionListener(void*, unsigned int, unsigned int, void const*) + 240 (AURemoteIO.cpp:265)
    4. 1   AudioToolbox                      0x00000002294260a8 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 140 (AURemoteIO.cpp:264)
    5. 2   AudioToolbox                      0x00000002294c63c8 AudioSessionPropertyListeners::CallPropertyListenersImp(AudioSessionPropertyListeners const&, uns... + 748 (AudioSessionPropertyListeners.cpp:121)
    6. 3   AudioToolbox                      0x00000002295bc0e4 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 220 (AudioSessionPropertyListeners.h:95)
    7. 4   AudioToolbox                      0x00000002295fec44 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 824 (AudioSession.cpp:924)
    8. 5   AudioToolbox                      0x00000002295fd9f4 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 568 (AudioSession.cpp:1042)
    9. 6   AudioToolbox                      0x00000002295fd4c8 ASCallbackReceiver_AudioSessionPingMessage + 588 (AudioSession.cpp:1152)
    10. 7   AudioToolbox                      0x00000002294b6ea4 _XAudioSessionPingMessage + 52 (AS_ListenerServer.c:159)
    11. 8   AudioToolbox                      0x00000002297fe1a8 mshMIGPerform + 232
    12. 9   CoreFoundation                    0x0000000225477da0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1996)
    13. 10  CoreFoundation                    0x00000002254774ec __CFRunLoopDoSource1 + 440 (CFRunLoop.c:2133)
    14. 11  CoreFoundation                    0x0000000225472310 __CFRunLoopRun + 2096 (CFRunLoop.c:3152)
    15. 12  CoreFoundation                    0x00000002254717c0 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
    16. 13  AVFAudio                          0x000000022b3e3334 GenericRunLoopThread::Entry(void*) + 156 (GenericRunLoopThread.h:92)
    17. 14  AVFAudio                          0x000000022b40dc60 CAPThread::Entry(CAPThread*) + 88
    18. 15  libsystem_pthread.dylib           0x00000002251042c0 _pthread_body + 128 (pthread.c:857)
    19. 16  libsystem_pthread.dylib           0x0000000225104220 _pthread_start + 44 (pthread.c:884)
    20. 17  libsystem_pthread.dylib           0x0000000225107cdc thread_start + 4
     
  16. phuongnh

    phuongnh

    Joined:
    Sep 23, 2019
    Posts:
    22
    Does anyone know how to reproduce this issue?
     
  17. tnoji

    tnoji

    Joined:
    Feb 21, 2017
    Posts:
    2
    sheehanm likes this.
  18. phuongnh

    phuongnh

    Joined:
    Sep 23, 2019
    Posts:
    22
    I can reproduce this crash, finally.
    I'm using Google AdMob in my game. When the interstitial is showing, let try to make a call to your phone, the crash sometimes happens.

    Search around on the internet, we should listen to the audio interruption event and pause the audio, then resume it when the interruption is end.

    Here is how I fixed it:
    Code (CSharp):
    1. // somewhere in your app initialization
    2. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruptionChangeToState:) name:AVAudioSessionInterruptionNotification object:nil];
    Handle interruption events:
    Code (CSharp):
    1. - (void)handleInterruptionChangeToState:(NSNotification *)notification {
    2.     NSDictionary *interuptionDict = notification.userInfo;
    3.     NSInteger interuptionType = [[interuptionDict valueForKey:AVAudioSessionInterruptionTypeKey] integerValue];
    4.  
    5.     if (interuptionType == AVAudioSessionInterruptionTypeBegan){
    6.         NSLog(@"AVAudioSessionInterruptionTypeBegan");
    7.         UnitySetAudioSessionActive(false);
    8.         _pausedByInterruption = YES;
    9.     }
    10.     else if (interuptionType == AVAudioSessionInterruptionTypeEnded){
    11.         NSLog(@"AVAudioSessionInterruptionTypeEnded");
    12.         if (_pausedByInterruption)
    13.         {
    14.             UnitySetAudioSessionActive(true);
    15.             _pausedByInterruption = NO;
    16.         }
    17.     }
    18. }
    Don't forget to clean up:
    Code (CSharp):
    1. - (void)dealloc {
    2.     [[NSNotificationCenter defaultCenter] removeObserver:self name:AVAudioSessionInterruptionNotification object:nil];
    3. }
    Updated: Let make a video call via Face Time, game crashed immediately, not showing an ad.

    Hope this might help.
     
    Last edited: Apr 17, 2020
  19. gate1

    gate1

    Joined:
    May 31, 2013
    Posts:
    22
    Hi guys! What is expected ETA for this fix?
     
  20. hlorenzo93

    hlorenzo93

    Joined:
    Apr 20, 2016
    Posts:
    4
    Also happen in my game,

    Code (CSharp):
    1. Thread 31 name:
    2. Thread 31 Crashed:
    3. 0   libEmbeddedSystemAUs.dylib        0x00000001c7418cdc InterruptionListener(void*, unsigned int, unsigned int, void const*) + 352 (AURemoteIO.cpp:257)
    4. 1   libEmbeddedSystemAUs.dylib        0x00000001c7418c10 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148 (AURemoteIO.cpp:256)
    5. 2   AudioToolbox                      0x00000001b3f84050 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596 (AudioSessionPropertyListeners.cpp:146)
    6. 3   AudioToolbox                      0x00000001b3fde224 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144 (AudioSession.cpp:932)
    7. 4   AudioToolbox                      0x00000001b3fdd94c ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2452 (AudioSession.cpp:1050)
    8. 5   AudioToolbox                      0x00000001b3fdcc08 ASCallbackReceiver_AudioSessionPingMessage + 632 (AudioSession.cpp:1161)
    9. 6   AudioToolbox                      0x00000001b404af70 _XAudioSessionPingMessage + 44 (AS_ListenerServer.c:163)
    10. 7   libAudioToolboxUtility.dylib      0x00000001b40de3a0 mshMIGPerform + 264 (MachServerHelper.c:450)
    11. 8   CoreFoundation                    0x00000001a8cf0200 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1937)
    12. 9   CoreFoundation                    0x00000001a8cef90c __CFRunLoopDoSource1 + 444 (CFRunLoop.c:2075)
    13. 10  CoreFoundation                    0x00000001a8cea6c0 __CFRunLoopRun + 1888 (CFRunLoop.c:3098)
    14. 11  CoreFoundation                    0x00000001a8ce9c34 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3192)
    15. 12  AVFAudio                          0x00000001b5a925dc GenericRunLoopThread::Entry(void*) + 156 (GenericRunLoopThread.h:91)
    16. 13  AVFAudio                          0x00000001b5ae3300 CAPThread::Entry(CAPThread*) + 204 (CAPThread.cpp:286)
    17. 14  libsystem_pthread.dylib           0x00000001a8a87d98 _pthread_start + 156 (pthread.c:896)
    18. 15  libsystem_pthread.dylib           0x00000001a8a8b74c thread_start + 8
    Any solution?
     
  21. YorkYoung

    YorkYoung

    Joined:
    Nov 16, 2016
    Posts:
    4
    Also happen in my game on ios 13.x
    Unity 5.6.4p1


    0 libEmbeddedSystemAUs.dylib InterruptionListener(void*, unsigned int, unsigned int, void const*) + 352
    1 libEmbeddedSystemAUs.dylib InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148
    2 AudioToolbox AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
    3 AudioToolbox HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
    4 AudioToolbox ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2240
    5 AudioToolbox _ASCallbackReceiver_AudioSessionPingMessage + 636
    6 AudioToolbox __XAudioSessionPingMessage + 44
    7 libAudioToolboxUtility.dylib _mshMIGPerform + 264
    8 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    9 CoreFoundation ___CFRunLoopDoSource1 + 444
    10 CoreFoundation ___CFRunLoopRun + 2168
    11 CoreFoundation CFRunLoopRunSpecific + 464
    12 AVFAudio GenericRunLoopThread::Entry(void*) + 156
    13 AVFAudio CAPThread::Entry(CAPThread*) + 204
    14 libsystem_pthread.dylib _pthread_start + 156
     
  22. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    66
    The crash I get is a little different :

    I've got these: "BaseOpaqueObject::ResolveOpaqueRef"

    Code (CSharp):
    1.  
    2. Thread 29 name:
    3. Thread 29 Crashed:
    4. 0   libAudioToolboxUtility.dylib      0x00000001b22f8c0c BaseOpaqueObject::ResolveOpaqueRef(BaseOpaqueObject::RTTI const&, BaseOpaqueObject::Ref) + 64 (OpaqueObjectMgr.cpp:152)
    5. 1   libAudioToolboxUtility.dylib      0x00000001b22f8bec BaseOpaqueObject::ResolveOpaqueRef(BaseOpaqueObject::RTTI const&, BaseOpaqueObject::Ref) + 32 (OpaqueObjectMgr.cpp:87)
    6. 2   libEmbeddedSystemAUs.dylib        0x00000001c5627214 InterruptionListener(void*, unsigned int, unsigned int, void const*) + 56 (OpaqueObjectMgr.h:198)
    7. 3   AudioToolbox                      0x00000001b21859ac AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596 (AudioSessionPropertyListeners.cpp:146)
    8. 4   AudioToolbox                      0x00000001b21dfb98 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144 (AudioSession.cpp:932)
    9. 5   AudioToolbox                      0x00000001b21df2c0 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2452 (AudioSession.cpp:1050)
    10. 6   AudioToolbox                      0x00000001b21de57c ASCallbackReceiver_AudioSessionPingMessage + 632 (AudioSession.cpp:1161)
    11. 7   AudioToolbox                      0x00000001b224c798 _XAudioSessionPingMessage + 44 (AS_ListenerServer.c:163)
    12. 8   libAudioToolboxUtility.dylib      0x00000001b22df430 mshMIGPerform + 264 (MachServerHelper.c:450)
    13. 9   CoreFoundation                    0x00000001a6ef02b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1937)
    14. 10  CoreFoundation                    0x00000001a6eef9c0 __CFRunLoopDoSource1 + 444 (CFRunLoop.c:2075)
    15. 11  CoreFoundation                    0x00000001a6eea774 __CFRunLoopRun + 1888 (CFRunLoop.c:3098)
    16. 12  CoreFoundation                    0x00000001a6ee9ce8 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3192)
    17. 13  AVFAudio                          0x00000001b3c93a2c GenericRunLoopThread::Entry(void*) + 156 (GenericRunLoopThread.h:91)
    18. 14  AVFAudio                          0x00000001b3ce47a0 CAPThread::Entry(CAPThread*) + 204 (CAPThread.cpp:286)
    19. 15  libsystem_pthread.dylib          0x00000001a6c87d98 _pthread_start + 156 (pthread.c:896)
    20. 16  libsystem_pthread.dylib          0x00000001a6c8b74c thread_start + 8
    21.  
    22. Thread 30:
    23. 0   libsystem_kernel.dylib            0x00000001a6d67104 __semwait_signal + 8
    24. 1   libsystem_c.dylib                0x00000001a6bcf748 nanosleep + 220 (nanosleep.c:104)
    25. 2   libsystem_c.dylib                0x00000001a6bcf618 usleep + 64 (usleep.c:52)
    26. 3   ipa                              0x0000000103d657f0 FMOD_OS_Time_Sleep(unsigned int) + 20
    27. 4   ipa                              0x0000000103d829d4 FMOD::Thread::callback(void*) + 228
    28. 5   libsystem_pthread.dylib          0x00000001a6c87d98 _pthread_start + 156 (pthread.c:896)
    29. 6   libsystem_pthread.dylib          0x00000001a6c8b74c thread_start + 8
    30.  
     
  23. andrefbr21

    andrefbr21

    Joined:
    Jan 27, 2013
    Posts:
    10
    I am also having the exact same issue on latest Unity 2018.4.25 LTS.

    Code (CSharp):
    1. Crashed: AVAudioSession Notify Thread
    2. EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x2d444336382d39e8
    3. 0
    4. libEmbeddedSystemAUs.dylib
    5. InterruptionListener(void*, unsigned int, unsigned int, void const*) + 352
    6. 1
    7. libEmbeddedSystemAUs.dylib
    8. InterruptionListener(void*, unsigned int, unsigned int, void const*) + 148
    9. 2
    10. AudioToolbox
    11. AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
    12. 3
    13. AudioToolbox
    14. HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
    15. 15
    16. libsystem_pthread.dylib
    17. thread_start + 8
     
  24. BoombitLicence25

    BoombitLicence25

    Joined:
    May 22, 2019
    Posts:
    3
    Same here, reported by firebase. All crashes occurred on iOS 13 (it might be a coincidence though)

    Crashed: AVAudioSession Notify Thread
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x72657375222c2416
    AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*)

    0 libEmbeddedSystemAUs.dylib 0x1bed150cc InterruptionListener(void*, unsigned int, unsigned int, void const*)
    1 libEmbeddedSystemAUs.dylib 0x1bed15000 InterruptionListener(void*, unsigned int, unsigned int, void const*)
    2 AudioToolbox 0x1ac1a95e8 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
    3 AudioToolbox 0x1ac208914 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
    4 AudioToolbox 0x1ac207f4c ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2240
    5 AudioToolbox 0x1ac2072dc ASCallbackReceiver_AudioSessionPingMessage + 636
    6 AudioToolbox 0x1ac275b78 _XAudioSessionPingMessage + 44
    7 libAudioToolboxUtility.dylib 0x1ac308288 mshMIGPerform + 264
    8 CoreFoundation 0x1a10e907c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    9 CoreFoundation 0x1a10e87a8 __CFRunLoopDoSource1 + 444
    10 CoreFoundation 0x1a10e367c __CFRunLoopRun + 2168
    11 CoreFoundation 0x1a10e2adc CFRunLoopRunSpecific + 464
    12 AVFAudio 0x1adca8c1c GenericRunLoopThread::Entry(void*) + 156
    13 AVFAudio 0x1adcf9d60 CAPThread::Entry(CAPThread*) + 204
    14 libsystem_pthread.dylib 0x1a0e85d8c _pthread_start + 156
    15 libsystem_pthread.dylib 0x1a0e8976c thread_start + 8
     
  25. andrefbr21

    andrefbr21

    Joined:
    Jan 27, 2013
    Posts:
    10
    Still having the issue in Unity 2018.4.26 LTS.
    It is affecting iOS users 13 for me.

    Any work around anyone?
     
  26. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Same with Unity 2019.4.5f1
     
  27. andrefbr21

    andrefbr21

    Joined:
    Jan 27, 2013
    Posts:
    10
    Still having the issue in Unity 2018.4.29 LTS.
    It is affecting iOS 13 and 14.
     
    sheehanm likes this.
  28. Rpkosh

    Rpkosh

    Joined:
    Mar 18, 2021
    Posts:
    1
    Does anyone know how to reproduce? or Fix this?
     
  29. G1NurX

    G1NurX

    Joined:
    Dec 25, 2012
    Posts:
    69
    I spent two days figuring it out. It's a bug in iOS's CoreAudio. Whether you're using fmod or wwise, this crash affects you. Long story short, audio engines try to stop audio output in the AVAudioSession's interruption callback. For example, wwise calls the AudioComponentInstanceDispose function in the interruption callback which makes AURemoteIO::~AURemoteIO to be called. However, in AVAudioSession notify thread, the InterruptionListener function was trying to access AURemoteIO::Stop(). The mutex in the InterruptionListener function is not well designed to handle such a condition.

    If you can read Chinese, you can find my analysis of this crash in detail at https://zhuanlan.zhihu.com/p/370791950
     
    Last edited: May 9, 2021