Bug 43469 - execute await App.Current.MainPage.DisplayAlert() twice will crash on UWP real phone
Summary: execute await App.Current.MainPage.DisplayAlert() twice will crash on UWP rea...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.1
Hardware: PC Windows
: Normal major
Target Milestone: UWP
Assignee: Bugzilla
URL:
: 49491 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-17 15:57 UTC by Mike
Modified: 2017-02-02 19:07 UTC (History)
7 users (show)

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


Attachments
sample (79.27 KB, application/x-rar)
2016-08-17 15:57 UTC, Mike
Details


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:
Status:
RESOLVED FIXED

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

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

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

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 2.3.4.184-pre1 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.

Thanks.
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.

Thanks.