Summary: | AOT issue with await Task<bool> on Visual Studio 2015 | ||
---|---|---|---|
Product: | iOS | Reporter: | Mark Smith <mark.smith> |
Component: | Mono runtime / AOT compiler | Assignee: | Zoltan Varga <vargaz> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | arpitj, gouri.kumari, joe, kumpera, kzu, miguel, mono-bugs+bugzilla, mono-bugs+monotouch, pj.beaman, rolf, sebastien, shrutis, udhams, vargaz |
Priority: | High | ||
Version: | XI 9.2 | ||
Target Milestone: | 9.2 (C6) | ||
Hardware: | PC | ||
OS: | Windows | ||
Tags: | VSXF | Is this bug a regression?: | --- |
Last known good build: | |||
Attachments: | Sample Project + Screenshot |
Description
Mark Smith
2015-10-15 22:50:35 UTC
Since this manifests only when building from VS, moving there. This usually happens when the -O=gsharedvt argument is not passed to the aot compiler. Could you attach the build output ? I have checked this issue and able to reproduce this issue using build Xamarin.VisualStudio_4.0.0.1587_74739827abbb98b1b6e751ed8428dff3d6fee28d monotouch-9.2.0.93_1a6b88f2b2305d50bad065ae4c7292ab6348ff60 and steps mentioned in bug description. Screencast: http://www.screencast.com/t/pu5uMz1ZvEO Exception: https://gist.github.com/Rajneesh360Logica/d5bf7de17ba8c49db4e9 VS IDE log: https://gist.github.com/Rajneesh360Logica/6ffea89c289196e9aa77 Observation: VS throws exception when launching application on physical device. REGRESSION: This issue is working fine with latest stable Xamarin.VisualStudio_3.11.1537_a11147b697db127e63af3b0811811a01c30a178e monotouch-9.0.1.29_1d27ac2cea28ce4baac7ca238122e0a8aea5d17a Environment Info: Device:iPhone 4s (iOS 9.0) Windows: https://gist.github.com/Rajneesh360Logica/8f734c7126ea55c91ca3 Mac: https://gist.github.com/Arpit360/438405f2b46da57a282f An update to comment 3 : VS Debug output : https://gist.github.com/Rajneesh360Logica/65c2496d6ad834c416c3 An update to comment 3: Build output : https://gist.github.com/Rajneesh360Logica/9a0517ade979718e5d8f @Zoltan -- I have verified that the "Share Generic Value Types" flag is checked in the VS project settings. I don't see any mtouch arguments for building in the IDE logs, would that be on the server side? If so, how can I retrieve those? As an additional data point, if you change the return type to be a simple Task instead of Task<bool>, it works. It also works if you remove the async/await dependency and use ContinueWith constructs (where the state machine is not created). Can you attach the mac side build log, its probably in some log file written to by the mac agent. It does look like it's in the build output: 2> Task Parameter:EnableGenericValueTypeSharing=True (TaskId:185) Here's the full output: https://gist.github.com/markjulmar/afa9e53b8c8633857b35 Could you run the app with the MONO_LOG_LEVEL environment variable set to 'debug' and attach the output ? In xs, it can be set in Project Options/Run/General, no idea where to set them in VS. Also, could you zip up the whole build directory on the build host (no idea where it is) and upload it somewhere ? I have checked this issue with latest Cycle 6 build Observation: Getting Exception System.ExecutionEngineException: Attempting to JIT compile method 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>:System.Runtime.CompilerServices.IAsyncMethodBuilder.PreBoxInitialization<TStateMachine> (TStateMachine&)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information. while app launches on physical device. As per comment I have googled https://bugzilla.xamarin.com/show_bug.cgi?id=34926#c12 MONO_LOG_LEVEL but observed that it works for android https://developer.xamarin.com/guides/android/advanced_topics/environment/ I have set MSBuild output to Diagnostic from Tools ->Option->Project and Solution ->Build and Run ->MSBUild Project build output to verbosity. Build output: https://gist.githubusercontent.com/Rajneesh360Logica/0973da90d126bba6f36f/raw/d29d9a1de05de2126737d0dcd0b5efde659db0b3/gistfile1.txt iOS Device Crash Log: https://gist.github.com/Arpit360/896726fd5998f7beae0a Please let me know if I can provide more info. Environment Info: Device : iPhone 4s (iOS 9.0) Mac: https://gist.github.com/Arpit360/6cc858733a7082596ca4 Windows:https://gist.github.com/Rajneesh360Logica/c3df4b889053d5b56560 Zoltan, is there anything more Arpit can provide? I can't reproduce this. I was using this package: https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=2102&host_id=63&revision_id=638133 and vs 2013 professional, plus x.ios 9.2.0.84 on the mac. Will try with vs2015. This was an AOT compiler problem, it should be fixed by mono master 99d732d4d508feabdf95d737850490a427fb89b6. @Sebastien, this looks like something we should get into C6SR1. Since this would be a regression against C5, this should likely go into C6-baseline. Zoltan, this applies fine to 4.2.0-branch, so I assume that this fix is what would fix our Cycle 6 as well, right? Backport request tracked in https://trello.com/c/GAuMo9G6/304-xvs-34926-aot-issue-with-await-task-bool-on-visual-studio-2015 QA: This can be verified with maccore/master aa23e77f7fe09eeabfdc573d0b9cb41afb12f370 In addition to the master, a build against cycle6/4.2 was created here, it is waiting to be built: https://code.internalx.com/Wrench/BuildDetails?buildId=f3841aa78de4df8e8a319e26214560a6 This is not really a regression, vs 2015 seems to generate different il, which exposed the problem in the generic sharing code. I have checked this issue with iOS http://storage.bos.internalx.com/macios-mac-master/aa/aa23e77f7fe09eeabfdc573d0b9cb41afb12f370/monotouch-9.3.0.166.pkg and observed that issue is mentioned in bug description working fine. App launched successfully on device. After launching the app Getting an exception of “System.Exception: Got an error from the web service. MSG:success” while tapped on Testing. Observation : As per my understanding this is the issue from service returning null data I have reported the bug for the same https://bugzilla.xamarin.com/show_bug.cgi?id=35130 Screencast: http://www.screencast.com/t/fkgfwTZM VS Environment Info: https://gist.github.com/Parmendrak/8c68d45c065965364f3b http://storage.bos.internalx.com/macios-mac-master/aa/aa23e77f7fe09eeabfdc573d0b9cb41afb12f370/monotouch-9.3.0.166.pkg OSX:10.10.5 As per bug target milestone is C6, I will verify this issue once the patch will merge in C6 Thanks for the feedback, so not a regression attributed to us, but our users will experience broken code when they move to VS 2015. I have checked this issue with latest Cycle 6 lane builds and observed that the fix for this issue has been merged with Cycle 6 lane builds. Hence I am closing this issue. Environment Info (Mac): https://gist.github.com/Udham1/afb7be7e414fea4aa44f Environment Info (Windows): https://gist.github.com/Udham1/d1b0e8981b2da9e5c247 Thanks! |