iOS 9 Crashing in _prepareForCAFlush with EXC_BAD_ACCESS KERN_INVALID_ADDRESS

前端 未结 4 1854
不思量自难忘°
不思量自难忘° 2021-01-07 23:42

With the release of iOS 9, we are seeing several crash reports for what appears to be a bug from Apple\'s side of things in iOS 9. This is happening across device types (iPh

相关标签:
4条回答
  • 2021-01-07 23:48

    I'm also facing this issue and I think that I found what might be causing it. Are you guys by any chance using SDWebImage? Because that's the only place where I found that CFRunLoopRun() is being called and also other people complained on: Dead thread ticket -> App Crash

    0 讨论(0)
  • 2021-01-07 23:54

    We encountered the a crash with a similar stack trace, and after a long investigation we found out that it was related to an other crash; fixing that also fixed this, however I'm still unsure how the two crashes are related.

    Here are the details about the other crash:

    We had a function call in one of our methods like

    AudioServicesAddSystemSoundCompletion(self.soundID,  
                                          [[NSRunLoop currentRunLoop] getCFRunLoop],  
                                          kCFRunLoopDefaultMode,  
                                          AudioServicesSystemSoundCompletion,  
                                          (void *)CFBridgingRetain(self)); 
    

    where AudioServicesSystemSoundCompletion looked like

    void AudioServicesSystemSoundCompletion(SystemSoundID ssID,  void *clientData) {  
         AudioServicesRemoveSystemSoundCompletion(ssID);  
         CFRelease(clientData);  
    }
    

    Executing that function call two or more times simultaneously caused the app to crash. We fixed this by passing NULL instead of (void *)CFBridgingRetain(self) and removing the CFRelease(clientData); line.

    Since this fix we no longer see the '_prepareForCAFlush' crash anymore.

    Also note that according to Crashlytics the device had very high memory usage each time the crash has reproduced.

    Hope this helps!

    0 讨论(0)
  • 2021-01-08 00:03

    For me the problem was that I was showing and dismissing the keyboard when the application was minimized.

    [self.textView becomeFirstResponder];
    [self.textView resignFirstResponder];
    

    I performed the above code on the applicationWillResignActive event. removing this code fixed the crash.

    0 讨论(0)
  • 2021-01-08 00:11

    Seems to be only affecting devices with 32-bit processors A5 and A6 - iPod 5th Gen, iPhone 4S/5/5C, iPad 2/Mini). No repro on our side either. These crashes started and ramped up with iOS 9 release and adoption. iOS v9.0.1 does not seem to fix it.

    0 讨论(0)
提交回复
热议问题