Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 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.
Created attachment 18443 [details]
Logs and About Visual Studio
Visual Studio will very frequently freeze hard when building a Xamarin Android project and the only method to recovering is force closing Visual Studio.
I have exactly the same problem but what I tried is
Clean the entire solution before building the project it appears to be stable and i will update the xamarin for visual studio
We need the backtrace from all the threads to diagnose this, and to fix it. It could just be another occurrence of bug #46707. Ben, can you repro it and get the traces, or is there some documentation/instructions we can pass to the reporters so they can gather it?
Until we get backtraces showing it's actually an android designer issue i'll leave it assigned against the Android component. There are known deadlocks in that code whereas we do not have known deadlocks in the android designer code.
Steve, are you still experimenting this issue? Thanks, Adrian
That error would not cause a hang or deadlock.
The known hangs/deadlocks are caused by the usage of AsyncManager when it does a blocking wait on async operations. I still think we need to remove all usages of that as, according to everything I've read so far, it still causes deadlocks even when used correctly.
Unfortunately there's nothing in the logs to indicate the issue was caused by AsyncManager, so until we have a confirmed cause we're just guessing.
There are no known deadlocks that are on our plate as far as I know. The VS team has requested full heap dumps if that is the case per your diagnosis Alan.
So, unless you can prove it's actually a VS deadlock, the stacktrace clearly shows this is a designer issue and we'll leave it in the Android Designer component.
Rather than logs, we need memory dumps.
@Steve @Danar if/when this happens again, could you please take such dumps to take a look?
@Alan, the Android designer triggers another build right after the VS build completes, and that was one of the culprits in the past, which why I'm leaving it in the designer component.
I uploaded the memory dumps and the issue was confirmed to be not related to the designer itself (so far). The problem is believed to be the CompleteOnCurrentThread invocation:
> Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() Line 839
> Merq.Async.Core.dll!Merq.AsyncManager.Run(System.Func<System.Threading.Tasks.Task> asyncMethod)
Reassigning this to General for now as there is still nothing actionable from our side. If there are issues with the designer they'd probably be best filed as a new bug with the relevant stacktraces/dumps attached so we can deal with them. We can use this bug to deal with the AsyncManager usage issues.
The same issue is causing the deadlock in bug #45278
That commit you indicated was actually the fix for this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=45278.
The deadlock this bug is dealing with was mitigated by changing `AsyncManager.Run` to `AsyncManager.RunAsync` as part of this commit, https://github.com/xamarin/XamarinVS/commit/f18ef199b768479ba936908ba82d24b9ade032b1, however the usage of `AsyncManager.RunAsync` is incorrect and can lead to deadlocks.
I'm waiting for Android Arnott to review a doc before I push it to the repository, but I want to leave this bug open until we can review the remaining usages of AsyncManager.Run/RunAsync. This one will probably need to be removed.
Let's assume this one is just a direct duplicate of bug #45278 then, which was an incorrect usage of AsyncManager.Run.
I filed bug #51580 to deal with the other AsyncManager.Run issue noted in this comment: https://bugzilla.xamarin.com/show_bug.cgi?id=46874#c10
*** This bug has been marked as a duplicate of bug 45278 ***