Bug 43328 - DisplayActionSheet() double-tap NullReferenceException crash Win8.1
Summary: DisplayActionSheet() double-tap NullReferenceException crash Win8.1
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.1
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-08-13 02:22 UTC by aculliney
Modified: 2016-09-12 17:37 UTC (History)
3 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Shows ActionSheet ready for spammy touch (11.16 KB, image/png)
2016-08-13 02:22 UTC, aculliney

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description aculliney 2016-08-13 02:22:51 UTC
Created attachment 17017 [details]
Shows ActionSheet ready for spammy touch

We have created a reduced test case project that shows a crash in DisplayActionSheet() on Win8.1.  Please see our public repository with the test case : https://bitbucket.org/luminixinc/actionsheetcrash81 .

The best way to reproduce the crash is to spam the central button that calls DisplayActionSheet() and hope you can also hit an action sheet item at least twice with your tapping.

Our app is currently hitting this issue in the wild for a number of clients who are inadvertently double-tapping an action sheet selection.  

We are not aware of any way to work around this issue at present time while still using the action sheet, due to it completely managing the ItemClick handler for us.  We believe the cause of the crash is likely setting the inner _currentActionSheet to null at line 646 in Xamarin.Forms.Platform.WinRT/Platform.cs (https://github.com/xamarin/Xamarin.Forms/blob/release-2.3.1/Xamarin.Forms.Platform.WinRT/Platform.cs#L646).  You may wish to add some delay there to try to make the test case more easily reproducible.

Comment 1 Samantha Houts [MSFT] 2016-08-17 18:42:14 UTC
Should be fixed in 2.3.3-pre1. Thank you!
Comment 2 aculliney 2016-09-12 17:37:15 UTC
Thank you Samantha!

For posterity, our test case has now moved to https://bitbucket.org/luminixinc/xamarintest/branch/ActionSheetCrash81