Crash SLComposeViewController initWithExtension

Originator:imarcelv
Number:rdar://35879620 Date Originated:12/06/17
Status:Open Resolved:No
Product:UIKit Product Version:11.1.1
Classification:Crash Reproducible:Sometimes
 
Summary:
After sharing something using UIActivityViewController and extensions (we especially noticed this with Slack), the extension crashes our app in the following thred: com.apple.extension.global-state-queue.

2  Social                         0x194a04dbc __66-[SLComposeViewController initWithExtension:requestedServiceType:]_block_invoke + 84
3  Foundation                     0x184103b04 __85-[NSExtension _completeRequestReturningItems:forExtensionContextWithUUID:completion:]_block_invoke + 108


We don't even use Social.framework anywhere in the app, so we also don't cause a crash by trying to use SLComposeViewController in iOS 11. We attached a crash report from Crashlytics as well. We did some research and this crash seems to appear for other developers as well. Take a look at the following examples:
- https://github.com/EstebanFuentealba/react-native-share/issues/84
- https://stackoverflow.com/questions/47055503/crash-on-slcomposeviewcontroller-initwithextensionrequestedservicetype-block
- https://github.com/artsy/eigen/issues/1349

We tried to share to items using UIActivityViewController: an instance of NSURL and a simple string.


Steps to Reproduce:
1. Share something using an extension (try Slack)
2. Press "Post" in extension's view controller
3. Extension crashes our app

Version/Build:
11.1.1 (15B150), iPhone SE

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!