Bug 52379 - Application UI freeze when NSUrlProtocol and UIWebView are used.
Summary: Application UI freeze when NSUrlProtocol and UIWebView are used.
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 10.3 (iOS 10.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-02-08 11:51 UTC by Alex
Modified: 2017-02-16 03:01 UTC (History)
3 users (show)

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


Attachments
Project to reproduce the bug (17.10 KB, application/zip)
2017-02-08 11:51 UTC, Alex
Details

Description Alex 2017-02-08 11:51:28 UTC
Created attachment 19756 [details]
Project to reproduce the bug

Application becomes freeze and unresponsive when NSUrlProtocol and UIWebView are used.

I implemented subclass of NSUrlProtocl and registered it to respone on image loading. In some moment application stops to respond to user actions. If if pause the program execution then I see that UIThread is blocked with following stack:

    Foundation.NSObject.xamarin_release_managed_ref() in 
    Foundation.NSObject.ReleaseManagedRef() in /Users/builder/data/lanes/3969/7beaef43/source/xamarinmacios/src/Foundation/NSObject2.cs:208
    Foundation.NSObject.NSObject_Disposer.Drain( ctx) in /Users/builder/data/lanes/3969/7beaef43/source/xamarinmacios/src/Foundation/NSObject2.cs:784


I've attached test project to reproduce the bug. You should click the "Refresh screen" button until application will have been freezed.
Also I've made a native project and there bug didn't appear.
Comment 1 Manuel de la Peña 2017-02-10 10:36:52 UTC
I have tested the application with the following env:

=== Xamarin Studio Community ===

Version 6.1.5 (build 0)
Installation UUID: 01060673-5bee-4cf4-a4c2-5e36a18d39a2
Runtime:
	Mono 4.8.0 (mono-4.8.0-branch/e8f4c7c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000289

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: 2.10.0.120 (Xamarin Studio Community)

=== Xamarin.Android ===

Version: 7.0.2.42 (Xamarin Studio Community)
Android SDK: /Users/mandel/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)

SDK Tools Version: 25.1.6
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: 10.3.1.8 (Xamarin Studio Community)
Hash: 7beaef4
Branch: cycle8-xi
Build date: 2016-12-20 02:58:14-0500

=== Xamarin Inspector ===

Version: 1.0.0.0
Hash: 1f3067d
Branch: master
Build date: 11/15/2016 10:13:59 PM

=== Build Information ===

Release ID: 601050000
Git revision: 7494718e127af9eaec45a3bd6282d3da927488bd
Build date: 2017-01-17 10:31:01-05
Xamarin addins: c92d0626d347aaa02839689eaac2961d24c9f446
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.3
Darwin MacBook-Pro.local 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Addin Maker 1.3.2
StyleCop Support 1.0.1.9
Xamarin Inspector 1.0.0.0
Manifest.addin 0.0.0.0

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