Bug 13193 - Nested async/await calls result in JIT exception
Summary: Nested async/await calls result in JIT exception
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
Depends on:
Reported: 2013-07-11 18:34 UTC by Greg Shackles
Modified: 2015-01-07 11:09 UTC (History)
4 users (show)

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

repro case (448.39 KB, application/zip)
2013-07-11 18:34 UTC, Greg Shackles

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 Greg Shackles 2013-07-11 18:34:21 UTC
Created attachment 4330 [details]
repro case

I'm running into an issue where async code is throwing a JIT exception when running on a device. If I remove some of the levels of async/await nesting it seems to help avoid the exception, so I'm hoping this is a runtime bug rather than an iOS limitation. Attached is a repro case for the crash.

Xamarin.iOS Version: (Business Edition)
Mono 3.0.12 ((no/d6c5db8)

2013-07-11 18:29:26.863 JitTest[45423:907] Unhandled managed exception: Attempting to JIT compile method 'JitTest.JsonRestClient:makeRequestAsync<JitTest.Person> (string)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
  at JitTest.JsonRestClient.GetAsync[Person] (System.String url) [0x00000] in <filename unknown>:0 
  at JitTest.JitTestViewController+<ViewDidLoad>c__async0.MoveNext () [0x00038] in /Users/greg/Projects/JitTest/JitTest/JitTestViewController.cs:28
Comment 2 Zoltan Varga 2013-07-17 14:40:09 UTC
As a workaround, ry calling the async method directly instead of through GetAsync().
Comment 3 Zoltan Varga 2013-07-20 09:07:50 UTC
This works now with mono 5e9f57b92f25e0cd0fef266cb713c54289c95c86.
Comment 4 Greg Shackles 2013-07-23 12:22:52 UTC
Is there a target for when this will reach Xamarin.iOS? I'm still getting this exception on 6.4.0.
Comment 5 Zoltan Varga 2013-07-23 12:29:48 UTC
That fix didn't made 6.4.0.
Comment 6 Greg Shackles 2013-08-12 20:50:12 UTC
Hate to be a pain, but is there a timeline yet on when this will make it into iOS/Android? This is a pretty big stopper for us at the moment. Thanks!
Comment 8 Zoltan Varga 2015-01-07 11:09:00 UTC
This was fixed a long time ago.