AVAudioSession currentRoute crash

We have received several crash reports from the application. They are all alike. The call to [AVAudioSession currentRoute] is at the top of each split stack:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)  
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000c0b25beb8  
Termination Signal: Segmentation fault: 11  
Termination Reason: Namespace SIGNAL, Code 0xb  
Terminating Process: exc handler [0]  
Triggered by Thread:  14  
...  

Thread 14 name:  
Thread 14 Crashed:  
0  libobjc.A.dylib  objc_msgSend + 16  
1  AVFAudio          -[AVAudioSession currentRoute] + 140 (AVAudioSession.mm:1715)  
...  

      

We found that the crash occurs in the AVAudioSessionRouteChangeNotification notification handler. In this handler, we send an asynchronous call to our custom sequential queue, where we get the current route and list all outputs.

- (instancetype)init  
{  
    if (self = [super init])  
    {  
          _commandsQueue = dispatch_queue_create("com.app.commandsQueue", DISPATCH_QUEUE_SERIAL);  
          [[NSNotificationCenter defaultCenter] addObserver:self  
              selector:@selector(handleRouteChanged:)  
              name:AVAudioSessionRouteChangeNotification  
              object:nil];  
    }  
    return self;  
}  

- (void)handleRouteChanged:(NSNotification *)notification  
{  
    dispatch_async(self.commandsQueue, ^{  
        AVAudioSession *audioSession = [AVAudioSession sharedInstance];  
        AVAudioSessionRouteDescription* currentRoute = audioSession.currentRoute;  
        for (AVAudioSessionPortDescription *outputPort in currentRoute.outputs)  
        {  
            if ([outputPort.portType isEqualToString:AVAudioSessionPortAirPlay])  
            {  
                // updating dictionary with status  
            }  
        }  
    });  
}  

      

We cannot reproduce the problem and we do not know the exact scenario. We played a lot with different rerouting scenarios, but we didn't see any glitches. Does anyone have any idea of ​​any possible root cause for this failure?

+3
ios exc-bad-access avaudiosession


source to share


No one has answered this question yet

Check out similar questions:

428
Symbolic iPhone App Crash Reports
3
Application error with AVAudioSession privateBeginInterruption
3
ID forVendor failed as EXC_BAD_ACCESS
1
AVAudioSession error in new topic
1
Crash on fast changes between dispatchers
0
Failure: AVAudioSession Notify topic EXC_BAD_ACCESS
0
Ios 10 crash log Queue dispatched: com.apple.main-thread
0
Changing views keeps giving me an attempt to represent vc1 to vc whose view is not in the window hierarchy



All Articles
Loading...
X
Show
Funny
Dev
Pics