Bug 17385 - Debugging hangs application with IntentService and HttpClient
Summary: Debugging hangs application with IntentService and HttpClient
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler (show other bugs)
Version: 4.10.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2014-01-22 18:49 UTC by Jon Goldberger [MSFT]
Modified: 2014-02-26 07:44 UTC (History)
2 users (show)

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


Attachments
Test project (11.34 KB, application/zip)
2014-01-22 18:49 UTC, Jon Goldberger [MSFT]
Details

Comment 1 Jon Goldberger [MSFT] 2014-01-22 18:51:11 UTC
From case 58400:
I have a sample application that hangs when debugging in Xamarin.Android 4.10.1 but not in 4.8.3. 

Run the application in the debugger and click on the button, the debug output will write out the length of a string returned from a website. Click the button again and the application hangs.

I realise that using .Result on an async call is bad, but I've tried various other combinations that use await in a production app and still get the same result. Running the app without debugging works fine. I'm pretty sure I'm doing something not quite right, but I'm not totally sure what it is. However, in 4.8.3 it did work and is debuggable.
---------------------------------------------------------------------------
Sorry, I should have confirmed what versions I was using. Xamarin.Studio Mac 4.2.2, OS X Mavericks (the hang also happened on Mountain Lion), Mono 3.2.5. I did try the beta 4.10.2, but that still hangs. When I reinstall 4.8.3, it works again. At first I thought this was just an issue with when debugging with the emulator, but I also experienced hangs when debugging on device.

Once again, just to clarify, the app only hangs when debugging - not when running outside of the debugger.
---------------------------------------------------------------------------
 I tried it with a different emulator, a 4.4 emulator works!, a 4.1.2 one however hangs. I created a new emulator, 4.1.2 (API 16), Nexus 4, Intel Atom x86, use Host GPU, and it hangs as well.
---------------------------------------------------------------------------
Sorry, more info. I just noticed that it's not the API level of the emulator, but the architecture. If I create an Intel based emulator I get a hang, if I create an ARM based one it does not hang.
Comment 2 Jonathan Pryor 2014-01-23 16:14:24 UTC
Jeff? Oh master of all things debugging? Halp?
Comment 3 Jeffrey Stedfast 2014-01-23 16:25:38 UTC
You got that wrong... the debugger is *my* master.

That said, I think Martin changed the way threading works in the http stack somewhat recently (well, 6 months ago maybe?).

Sounds like this is more dependent upon the class libraries and/or runtime than the XS debugger if downgrading back to 4.8.x works.

Maybe Zoltan will have ideas.
Comment 4 Sadik Ali 2014-02-25 07:27:41 UTC
I have checked this issue, but unable to reproduce this .

Checked With below Environments:
Mac
XS 4.2.2
XA 4.10.1, 4.10.2

I check with device Samsung S4 and Noticed that application not hanged:
Refer screen cast: http://screencast.com/t/lFkXTs4smv9

Also I checked With emulator, 4.1.2 (API 16), Nexus 4, Intel Atom x86. I made few click on button and noticed that application get hanged 
Refer screen cast: http://screencast.com/t/hlThVFNU6Rj2

Note You need to log in before you can comment on or make changes to this bug.