Share Extension crashing when sharing a screenshot and asking for Local Authentication

Originator:nicola.giancecchi
Number:rdar://37669113 Date Originated:February 19 2018, 3:18 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11.2.2 15C202
Classification: Reproducible:
 
Area:
Local Authentication Framework

Summary:

A share extension crashes when sharing a screenshot from the quick screenshot dialog (the editor that opens after taking a screenshot) and evaluating the Local Authentication policy.

Steps to Reproduce:

1) Install the attached project
2) Take a screenshot
3) Open the preview located on the bottom left corner of your screen
4) Tap on the Share button
5) Select the installed app extension

Expected Results:

I should be able to use the Share Extension after providing a correct authentication via Face ID/Touch ID/passcode.

Actual Results:

The share extension and the underlying system screenshot editor are crashing immediately after asking for Local Authentication.

Version/Build:

iOS 11.2.2 15C202

Configuration:

iPhone 6s 64GB Silver

sysdiagnose bug timestamp: 19/02/2018 14:59:02 (GMT+01:00)

Comments

Nicola Giancecchi

Still happening on iOS 11.3.1.

By nicola.giancecchi at May 16, 2018, 3:21 p.m. (reply...)

Apple Developer Relations

Thanks, we are working on the new information you provided. We appreciate your help!

By nicola.giancecchi at May 16, 2018, 3:16 p.m. (reply...)

Nicola Giancecchi

Hello,

Sorry, after your answer, I noticed that maybe I wrongly explained the problem. Effectively, the share extension seems not to crash, since the LA dialog is shown and works correctly (you can continue authenticating or cancel it). The component that seems to crash is the native screenshot editor introduced in iOS 11.

You can see it in the attached video: I take a screenshot, I open the screenshot editor, I tap on the share button and after that, I choose the demo app. Immediately, the screenshot editor disappears, but apparently not the LA dialog, which stays on screen and can authenticate correctly, and not the share extension (after your verifications).

I double checked the code and it's pretty similar to the example code given at https://developer.apple.com/documentation/localauthentication.

Let me know if you need more info.

Nicola @ Wire

By nicola.giancecchi at May 16, 2018, 3:15 p.m. (reply...)

Apple Developer Relations

We cannot reproduce.

We’re unable to reproduce the crash. I installed the app, took a screenshot, shared it to the app (had to enable the app to appear in the list first), then the app asked for Face ID authentication (had to allow the use of Face ID for the first time):

14:15:22.633653 +0100 ShareExtension 399 -[LAClient evaluatePolicy:options:uiDelegate:reply:] 2, { 2 = ""; }

The Face ID authentication successfully completed 2 seconds later:

14:15:24.201921 +0100 ShareExtension 399 -[LAClient evaluatePolicy:options:uiDelegate:reply:]_block_invoke -> { 1 = 1; 7 = <7acbf02c e05f2150 8dcd3d40 78e94175 b5f0a8f9 8416853d fed91eaa 47dbe145>; }

Nothing particular happened afterwards, but ShareExtension didn’t crash, it was still running.
Also, I didn’t find any ShareExtension crash in the attached sysdiagnose, indicating that it didn’t crash on the developer’s device either. As for the timestamp 14:59:02, I can’t see anything suspicious - Face ID was running at that time, but there does not seem to be any issue and it has returned (called the reply block) successfully at 14:59:09. And BTW, ShareExtension was running before and after that timestamp with the same PID, clearly indicating that it didn’t crash at that moment:

2018-02-19 14:59:01.692125 +0100 ShareExtension 12205 -[LAContext initWithExternalizedContext:] 0 on 2018-02-19 14:59:09.048856 +0100 ShareExtension 12205 -[LAContext dealloc] on

Please double check that ShareExtension really crashes and if you find the crash file in Xcode > Window > Devices, please attach it to this bug report. Also, please make sure that the crash does not happen in your code. The fact that your app crashed after calling LA does not necessarily mean that the crash is caused by LA.

Please update your bug report to let us know if this is still an issue for you, and provide any additional information.

By nicola.giancecchi at May 16, 2018, 3:12 p.m. (reply...)

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!