Bug 13541 - Enabling Thumb-2 causes odd "async" behavior
Summary: Enabling Thumb-2 causes odd "async" behavior
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.4.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
Depends on:
Reported: 2013-07-27 14:59 UTC by Dillon Buchananq
Modified: 2013-09-27 12:27 UTC (History)
2 users (show)

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

A test project using 'async' ViewDidAppear with a release deployment (6.25 KB, application/zip)
2013-07-29 23:30 UTC, Dillon Buchananq

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 Dillon Buchananq 2013-07-27 14:59:22 UTC
When Thumb-2 is enabled, and the application is running on an actual 6.1.3 iPhone device, it would appear that some async methods do not act appropriately. Take the following example:

Clone the following repository: https://github.com/marek-safar/samples.git

This repository makes use of async ViewDidLoad & ViewWillAppear methods and is a pretty simple experiment to reproduce this issue.

Compile, and upload the application to an iOS device (not the simulator) without Thumb-2 enabled. You'll notice everything works appropriately. When you click on the songs, you should see a detail view that has a bunch of "retrieving"s that eventually populate with data. Everything is good here.

Next, enabled Thumb-2, re-compile and upload the the device. When you run the application everything seems ok. However, click on a song. You'll notice that the detail view's "retrieving"s never go away. Infact, if you put some Console.WriteLine's in the DetailViewController's "ViewWillAppear" the method never gets called at all!
Comment 1 Zoltan Varga 2013-07-29 20:54:52 UTC
I get:

2013-07-30 02:53:50.482 AsyncDemo[5800:907] System.Net.Http.HttpRequestException: 403 (Forbidden)
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00000] in <filename unknown>:0 
  at System.Net.Http.HttpClient+<GetStreamAsync>c__async8.MoveNext () [0x00000] in <filename unknown>:0 

on the console, so this might be a server side request throttling issue.
Comment 2 Zoltan Varga 2013-07-29 20:57:37 UTC
It happens without thumb2 too.
Comment 3 Dillon Buchananq 2013-07-29 23:07:44 UTC
Hello Zoltan,
 I appreciate you looking into this. Perhaps the example was a little overkill. While I secretly hope that you're right and deploying the application to your phone in release worked I've created a very very simple project that reproduces the problem for me (https://gist.github.com/thedillonb/6109830) It's one file that has an async ViewDidAppear with an 'await Task.Delay()'. When I run it in debug on my phone, everything works fine. However, as soon as I switch it over to release and switch on the LLVM and Thumb-2 I get absolutely nothing. The entire function doesn't even get executed. No console output, no alert view.

I'm trying to uninstall the Xamarin.ios framework in hopes that something terrible has happened during the upgrade but it is much harder than expected.
Comment 4 Zoltan Varga 2013-07-29 23:24:23 UTC
I can't reproduce this. Can you attach a complete project for the testcase ?
Comment 5 Dillon Buchananq 2013-07-29 23:30:59 UTC
Created attachment 4478 [details]
A test project using 'async' ViewDidAppear with a release deployment
Comment 6 Dillon Buchananq 2013-07-29 23:33:18 UTC
I've attached the project. I've also just completely wiped Xamarin.ios off my system and re-installed. Unfortunately the problem still persists. I'm running a 'Release' deployment to my 6.1.3 iOS iPhone 4s.
Comment 7 Zoltan Varga 2013-07-30 00:34:48 UTC
I still can't reproduce this. I do notice that when I run the app, press the home button, and run it again, the message box doesn't appear, but that might be normal ios behavior.
Comment 8 Dillon Buchananq 2013-07-30 01:01:25 UTC
Alright, well I appreciate you trying. I was pretty confident that this had to be something on my side but am unable to figure out which part is not working appropriately. Never the less, you can close the defect as I'm unable to provide a reproduceable environment. My final question to you: what kind of iOS device are you testing on? I'm going to try and grab a few more and see if it could some how be related to my phone since I've pretty much reinstalled my development environment.
Comment 9 Zoltan Varga 2013-07-30 01:13:34 UTC
I'm trying on an ipad4 with ios 6.1.3.
Comment 10 Rolf Bjarne Kvinge [MSFT] 2013-09-27 12:27:28 UTC
The sample works fine for me too on Xamarin.iOS 7.0 and iPad3/6.1.3.