Bug 25510 - Web service call from a Thread after the device was locked causes app to hang
Summary: Web service call from a Thread after the device was locked causes app to hang
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: XI 8.4.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
Depends on:
Reported: 2014-12-18 14:37 UTC by John Miller [MSFT]
Modified: 2015-02-17 10:32 UTC (History)
2 users (show)

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

Test Case (25.34 KB, application/zip)
2014-12-18 14:38 UTC, John Miller [MSFT]

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 for Bug 25510 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description John Miller [MSFT] 2014-12-18 14:37:26 UTC

   The attached sample reproduces the issue. After a new ThreadStart the app will hang when there is a web reference service call in that Thread. This only seems to happen if the device is locked -> then unlocked and the app resumed again. 

**Steps to Reproduce:**

   1. Run the attached sample on a device
   2. Type in a value and press the "Convert" button
   3. Notice that the service call works and the temperature is converted
   4. Lock the device (the debugger will disconnect)
   5. Unlock the device
   6. If the app is not in the foreground already, open it
   8. Type in a new value just to confirm, and the press "Convert" again
   9. The temp is not converted and the Thread seems to be hanging
   10. Touch Convert again and the app will hang and become unresponsive

**Actual Results:**

   App hangs

**Expected Results:**

   No hang, service call is successful

**Build Date & Platform:**

   Mono 3.10.0

**Additional Information:**

   I did notice that the ThreadStart is just executing the code on the main thread. I modified that for testing to only  update the UI on the main thread and do the service call on the Thread, but it produced the same results as above.
Comment 1 John Miller [MSFT] 2014-12-18 14:38:07 UTC
Created attachment 9131 [details]
Test Case
Comment 2 Udham Singh 2014-12-19 06:53:28 UTC
I have checked this issue with the help of sample app attached in comment 1 and instructions provided in bug description, and observed the same behavior mentioned in bug description.

Screencast : http://www.screencast.com/t/hP2pr86n8S

iOS Device Log : https://gist.github.com/AkhileshKumar01/d56804ebd9678fc9caa0
iOS Designer Log : https://gist.github.com/AkhileshKumar01/40a4d05bb65a2816cb66
Ide Log : https://gist.github.com/AkhileshKumar01/7d7aef712d77fa48dda7

Environment info : 

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: ff0c16c6-3c75-46d8-ac56-56c3b56e2c76
 Mono 3.10.0 ((detached/92c4884)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 310000031

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: (Indie Edition)
Hash: 7244769
Build date: 2014-12-11 14:54:30-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.1
Darwin Apples-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-02-17 10:22:13 UTC
Zoltan, it looks like the app hangs due to the debugger waiting for something: https://gist.github.com/rolfbjarne/35bbb56fbe0476764c81
Comment 4 Zoltan Varga 2015-02-17 10:32:12 UTC
The debugger is probably waiting for the ide to resume the app.