Bug 43469

Summary: execute await App.Current.MainPage.DisplayAlert() twice will crash on UWP real phone
Product: Forms Reporter: Mike <huangjinshe>
Component: FormsAssignee: Bugzilla <bugzilla>
Severity: major CC: bebuttig, daniel.klokov, ehart, jas, parmendrak, paul.dipietro, rui.marinho
Priority: Normal    
Version: 2.3.1   
Target Milestone: UWP   
Hardware: PC   
OS: Windows   
Tags: ac Is this bug a regression?: ---
Last known good build:
Attachments: sample

Description Mike 2016-08-17 15:57:19 UTC
Created attachment 17084 [details]

This will let application crash on real phone.  not on desktop application.   I'm testing it on Lumia 640XL

btn.Clicked += (sender, argas) =>

                Device.BeginInvokeOnMainThread(new Action(async () =>
                    await App.Current.MainPage.DisplayAlert("test", "test", "cancel");

                Device.BeginInvokeOnMainThread(new Action(async () =>
                    await App.Current.MainPage.DisplayAlert("test", "test", "cancel");


I also upload the sample you could test it.
Comment 1 Daniel 2016-12-08 16:49:51 UTC
Hi there,

this bug exists on Windows 8.1 and there is no way to catch the exception thrown inside DisplayAlert task. Here is a link https://forums.xamarin.com/discussion/comment/238949#Comment_238949 to discussion created on Xamarin forum. To reproduce the issue please use demo project I have created to demonstrate the issue: https://github.com/MrClockOff/DisplayAlerTest

Comment 2 Paul DiPietro [MSFT] 2016-12-08 19:27:18 UTC

We're aware of this bug and have a potential fix in place (https://github.com/xamarin/Xamarin.Forms/pull/347), but have to do some reviewing of it to decide if it's the best solution. This doesn't guarantee that this particular fix will be used, but I've brought attention back onto it since we let it stagnate a bit.
Comment 3 E.Z. Hart [MSFT] 2016-12-09 19:15:55 UTC
*** Bug 49491 has been marked as a duplicate of this bug. ***
Comment 4 Rui Marinho 2016-12-16 16:03:08 UTC
Should be fixed in 2.3.4-pre2
Comment 5 Parmendra Kumar 2017-02-02 17:50:34 UTC
I have checked this issue with Xamarin.Forms and this issue not reproducible with latest forms version. To verify this issue I have used sample provided in comment #1.

Hence marked this issue as Verified Fixed.

Comment 6 Parmendra Kumar 2017-02-02 19:07:45 UTC
An update for comment #5,

By mistake I have checked this issue with simulator and local machine and this issue is related to real device.
Hence changed status to Resolved Fixed, I will retest this issue with real phone and update for the same.