Bug 29133 - [XVS 3.11] Visual Studio hangs when debugging some iOS and Android applications that use multiple threads
Summary: [XVS 3.11] Visual Studio hangs when debugging some iOS and Android applicatio...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 3.11 (C5)
Hardware: PC Windows
: Normal normal
Target Milestone: 3.11.1 (C5SR1)
Assignee: Jose Gallardo
Depends on:
Reported: 2015-04-15 17:16 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-05-10 16:58 UTC (History)
10 users (show)

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

Test case (15.08 KB, application/zip)
2015-04-15 17:16 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Log files (9.37 KB, application/zip)
2015-04-15 17:17 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 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 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-15 17:16:25 UTC
Created attachment 10777 [details]
Test case

Visual Studio hangs with Xamarin Android Player when debugging some Android applications that use multiple threads

Regression status: REGRESSION between 3.9.547 (20fd2f0) and 3.11.428.0 (b305980).

## Steps to reproduce

1. Open the attached test case in Visual Studio. This is just a new template project with the following line added in the `OnCreate()` override:
> System.Threading.ThreadPool.QueueUserWorkItem((c) => { System.Threading.Thread.Sleep(10000); Console.WriteLine("Hello world"); });

2. Run the Android app on the Nexus 4 (KitKat) Xamarin Android Player. (I tested this on a Windows VM, so I had XAP running on the Mac host machine [1].)

> [1] http://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/android-player-with-visual-studio-in-vm/

3. Wait until about 10 seconds have elapsed.

## Results

Visual Studio hangs. The app on the device becomes non-responsive as well.

It looks like maybe the "Main Thread" gets stuck somewhere during `Mono.Debugger.Soft.Connection.SendReceive()`. (See "VSThreads.tsv" in the attached logs.)

## Expected results

Xamarin Studio on Windows does not hang or create a non-responsive app state.

Visual Studio does _not_ hang when running the app on an LG Optimus L9 (Android 4.1.2) device.

## Version information

### Windows 8.1 64-bit, in VMWare Fusion 6.0.5 (2209127)

Xamarin   3.11.428.0 (b305980)
Xamarin.Android (218021d1c15e4f6165061767f800f31efb02b72f)

### OS X 10.9.5, MacBook Air

Xamarin Android Player 0.3.7 (1)
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-15 17:17:09 UTC
Created attachment 10778 [details]
Log files
Comment 4 Akhilesh kumar 2015-04-24 10:24:55 UTC
I have checked this issue with attached test project and I am able to run/deploy project on XAP successfully and VS does not hang.

Screencast: http://screencast.com/t/SjR1hhwX

So closing this issue.

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.6.00030

Installed Version: Professional

Xamarin   3.11.465.0 (d878473)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (9c313ed01b0da39262c5ba3a1a06a0c28f2369e0)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS (7741cc495ab0baf04ff0405d0604bc27f0ecae2e)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2015-05-04 21:35:34 UTC
Updating the summary of the bug for accuracy. According to my tests today, this bug affects both iOS and Android apps.
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2015-05-08 13:44:28 UTC
Just for extra bookkeeping, I'll note that as tracked by the current forum release threads [1], [2], the fix for this issue has been released to the Alpha channel as of XVS 3.11.507 on May 5, 2015.

> [1] http://forums.xamarin.com/discussion/40277/alpha-service-release-xamarinvs-3-11-507-bug-fixes-for-3-11-445/p1
> [2] http://forums.xamarin.com/discussion/37275/stable-release-xamarinvs-3-11-445-new-features-and-bug-fixes/p1