Bug 56902 - Project crashes with gc bridge tarjan and runs fine with the old gc bridge implementation.
Summary: Project crashes with gc bridge tarjan and runs fine with the old gc bridge im...
Status: NEEDINFO
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
: 47577 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-27 07:46 UTC by Ilnur
Modified: 2017-09-29 14:01 UTC (History)
11 users (show)

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


Attachments

Description Ilnur 2017-05-27 07:46:14 UTC
I'm attaching a sample project to this bug-report:
https://github.com/lexboss93/tarjan_issue_reproduce

STEPS TO REPRODUCE:
1. Run project.
2. Swipe ImageView left and right.
3. See app crashes with System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Android.Widget.Toast'.
then:
4. open /objdisposed/environment.txt and change it's content to:
MONO_GC_PARAMS=bridge-implementation=old
5. Clean project.
6. Run project again.
7. Make sure bridge implementation has switched to old, i.e. see GC_OLD_BRIDGE tag in console:
	05-27 06:43:06.645 D/Mono    ( 1949): GC_OLD_BRIDGE num-objects 18 num_hash_entries 23 sccs size 20 init 0.00ms df1 0.07ms sort 0.02ms dfs2 0.12ms setup-cb 0.01ms free-data 0.01ms links 20/20/14/3 dfs passes 61/40
8. Swipe ImageView left and right.
9. See app runs okay.


PROJECT DETAILS:
It has an activity with custom ImageView (ScalableImageView) in layout. Whenever you run project with bridge-implementation=tarjan and swiping image view left and right it crashes, saying object disposed. In each crash case on of these is disposed:
Android.Widget.Toast
Android.Graphics.Matrix
Android.Views.GestureDetector

To make issue happen more quicker I am starting task in Activity's OnCreate method:
Task MemoryPressure ()
{
	return Task.Run (async () => {

		while (true) {
			byte [] f = new byte [1000 * 1000 * 5];
			await Task.Delay (300);
			f = null;
		}
	});
}

But the project runs fine with
MONO_GC_PARAMS=bridge-implementation=old


I've seen xamarin android user's complains about crashes occuring when System.ObjectDisposedException is thrown.
But none of them did attach a sample project.
See: https://forums.xamarin.com/discussion/93649/gesture-detector-system-objectdisposedexception

Users often complained to owners of various libraries about this crashes, but authors didn't investigated such problems much probably because they never faced them themselves.
See: https://github.com/Cheesebaron/SlidingMenuSharp/issues/20
Comment 1 Jon Douglas [MSFT] 2017-06-27 17:59:45 UTC
Unfortunately, we’re unable to reproduce this report. If this issue is still occurring for you, please add the following details:

Full Version Information and Log Files

In Xamarin Studio, version information can be obtained by navigating to: Xamarin Studio -> About Xamarin Studio -> Show Details -> Copy Information button (on Mac) or Help -> About -> Show Details -> Copy Information button (on Windows) and the log files can be found from Help -> Open Log Directory

In Visual Studio, version information can be copied from: Help -> About Microsoft Visual Studio -> Copy Info button and the log files can be gathered from %LOCALAPPDATA%\Xamarin\Log

Attempts at reproducing:

I had swiped up to 200 times in which I did not experience this object disposal when using tarjan as the default bridge implementation on multiple devices(Nexus 5, Nexus 6, Pixel running Android 6-7). Is it possible that you can add which device and API level you are using as well in hopes of confirming this faster?

I am thus marking this issue as NEEDINFO until further information.
Comment 2 Matthew Richardson 2017-07-03 13:20:03 UTC
Tarjan is a better GC and is a lot more aggressive in its mode of operation and hence it has brought to light a number of issues related to ObjectDisposedException.

Xamarin are working to identify and resolve these as they are individually reported. We noticed this starting XF 2.3.4-pre and was then fixed in XF 2.3.4. Now with XF 2.3.5-pre there is a similar issue once again with the new fast renderers.
Comment 3 Jonathan Pryor 2017-07-03 13:24:34 UTC
*** Bug 47577 has been marked as a duplicate of this bug. ***
Comment 4 Ilnur 2017-07-05 12:30:04 UTC
Hi! I'm appending visual studio's version information, log files (they are at %LOCALAPPDATA%\Xamarin\Logs\15.0) and video on youtube, which demonstrates how the problem is manifested on my computer:
https://www.youtube.com/watch?v=3CPh4sAdGxE

Microsoft Visual Studio Community 2017
Version 15.0.26228.12 D15RTWSVC
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA157
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA157
Microsoft Visual C# 2017

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Merq   1.1.13-alpha (2f64b6d)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Xamarin   4.3.0.795 (aece090)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.1.0.43 (3a62f1e)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.6.0.9 (a05f40e)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

=======================================================================
monodroid-2017-07-05__13-58-37.15760.log:

MonoDroidLog: Information: 0: [I:]:                     Found Xamarin.Android 7.1.0
MonoDroidLog: Information: 0: [I:sdk]:                  Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android
MonoDroidLog: Information: 0: [I:sdk]:                  Framework path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\common7\ide\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_8942e2e9\Android\AndroidSdkDirectory found:
    Path contains adb in \platform-tools (E:\Program Files\Android\sdk).
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_8942e2e9\Android\AndroidNdkDirectory found:
    Path contains ndk-stack in \. (C:\ProgramData\Microsoft\AndroidNDK\android-ndk-r10e\).
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_8942e2e9\Android\JavaSdkDirectory found:
    Path does not contain jarsigner.exe in \bin (C:\Program Files\Java\jdk1.7.0_51).
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_8942e2e9\Android\JavaSdkDirectory found:
    Path does not contain jarsigner.exe in \bin (C:\Program Files\Java\jdk1.7.0_51).
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\Xamarin\VisualStudio\15.0_8942e2e9\Android\JavaSdkDirectory not found.
MonoDroidLog: Information: 0: [I:sdk]:                  Looking for Java 6 SDK..
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion not found.
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion found.
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.6\JavaHome not found.
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.7\JavaHome not found.
MonoDroidLog: Information: 0: [I:sdk]:                    Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.8\JavaHome found:
    Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk1.8.0_131).
MonoDroidLog: Information: 0: [I:]:                     Found Android SDK. API levels: 15, 19, 21, 22, 23
MonoDroidLog: Information: 0: [I:]:                     Tracking android devices started
MonoDroidLog: Information: 0: [D:]:                     TrackDeviceTask got: 192.168.154.101:5555	device
MonoDroidLog: Information: 0: [D:]:                     Tracking avd started
MonoDroidLog: Information: 0: [D:]:                     avd watcher *.ini path: 'C:\Users\Ilnur\.android\avd'
MonoDroidLog: Information: 0: [I:]:                     Got new device list from adb with 1 devices
MonoDroidLog: Information: 0: [D:]:                     avd watcher: got device list from avd with 0 devices
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8915:8916,timeout=1499169959,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [I:]:                     Found Android SDK. API levels: 15, 19, 21, 22, 23
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_23,com.example.objdisposed" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions"
MonoDroidLog: Information: 0: [D:InstallPackage]:       Checking whether app com.example.objdisposed is running
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:InstallPackage]:       App was not running, skipping kill
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "pm" "path" "com.example.objdisposed"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ls /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Enumerating remote files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Determining required operations
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Creating directories
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__ 0
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Uploading files
MonoDroidLog: Information: 0: [D:NotifySync]:           CopyFile C:\Users\Ilnur\Documents\Visual Studio 2017\Projects\tarjan_issue_reproduce\objdisposed\obj\Debug\android\assets\objdisposed.dll /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__/objdisposed.dll 13824
MonoDroidLog: Information: 0: [D:NotifySync]:           CopyFile C:\Users\Ilnur\Documents\Visual Studio 2017\Projects\tarjan_issue_reproduce\objdisposed\obj\Debug\android\assets\objdisposed.dll.mdb /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__/objdisposed.dll.mdb 4117
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Upload completed
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Enumerating remote files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Determining required operations
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Creating directories
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__ 0
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__/lib 0
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Uploading files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Upload completed
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Enumerating remote files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Determining required operations
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Creating directories
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__ 0
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__/dexes 0
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Uploading files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Upload completed
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Enumerating remote files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Determining required operations
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Creating directories
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__ 0
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Uploading files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Upload completed
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Enumerating remote files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Determining required operations
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Creating directories
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__ 0
MonoDroidLog: Information: 0: [D:NotifySync]:           SkipCreateDirectory  /mnt/shell/emulated/0/Android/data/com.example.objdisposed/files/.__override__/resources 0
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Uploading files
MonoDroidLog: Information: 0: [D:NotifyPhase]:          Upload completed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8917:8918,timeout=1499170019,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8919:8920,timeout=1499170378,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8921:8922,timeout=1499170445,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8923:8924,timeout=1499170784,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 date +%s
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.extra" "debug=127.0.0.1:8925:8926,timeout=1499170843,loglevel=0,server=y"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_SOURCE}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 "echo" "-n" "${EMULATED_STORAGE_TARGET}"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.example.objdisposed/md5e66ee0d5b1bfb67163a8fa67c7335632.MainActivity"
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 ps
MonoDroidLog: Information: 0: [D:GetLogCat]:            logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 logcat -v time
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 am force-stop com.example.objdisposed
MonoDroidLog: Information: 0: [D:RunShellCommand]:      192.168.154.101:5555 setprop "debug.mono.connect" ""
MonoDroidLog: Information: 0: [D:]:                     TrackDeviceTask got: FA41PW902511	offline, 192.168.154.101:5555	device
MonoDroidLog: Information: 0: [I:]:                     Got new device list from adb with 2 devices
MonoDroidLog: Information: 0: [D:]:                     TrackDeviceTask got: FA41PW902511	device, 192.168.154.101:5555	device
MonoDroidLog: Information: 0: [I:]:                     Got new device list from adb with 2 devices
MonoDroidLog: Information: 0: [D:RunShellCommand]:      FA41PW902511 getprop
MonoDroidLog: Information: 0: [D:RunShellCommand]:      FA41PW902511 getprop
MonoDroidLog: Information: 0: [D:]:                     TrackDeviceTask got: 192.168.154.101:5555	device
MonoDroidLog: Information: 0: [I:]:                     Got new device list from adb with 1 devices
Comment 5 Ilnur 2017-07-06 08:33:29 UTC
The same happens on mac with the latest updates from stable channel (version info below) and genymotion emulator Nexus 7 Api 22.

Also, tested it on real device Samsung SM-T815 Api 23 (swiped about hundred times), debugger doesn't catch exception. Instead, the app crashes with the following output in Application output:
[mono-rt] =================================================================
[mono-rt] Got a SIGSEGV while executing native code. This usually indicates
[mono-rt] a fatal error in the mono runtime or one of the native libraries 
[mono-rt] used by your application.
[mono-rt] =================================================================
[mono-rt] 
[libc] Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 11091 (ple.objdisposed).
But with the old bridge it's OK.

=== Xamarin Studio Community ===

Version 6.3 (build 864)
Installation UUID: 183e65ea-49c6-4e59-906c-fb09d12c4d10
Runtime:
	Mono 5.0.1.1 (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

=== NuGet ===

Version: 3.5.0.0

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: 10.10.0.36 (Xamarin Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

=== Xamarin.Android ===

Version: 7.3.1.2 (Xamarin Studio Community)
Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

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

=== Xamarin.Mac ===

Version: 3.4.0.36 (Xamarin Studio Community)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 603000864
Git revision: 6c2f6737278ccc3e81e12276d49c0d92f975f189
Build date: 2017-04-24 11:26:01-04
Xamarin addins: d8d46e577d8507c35260ce9d73df3c33415bb214
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin <erased> 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 6 Namyslaw Szymaniuk 2017-07-12 09:33:49 UTC
Any update on this ticket?
Comment 7 Israel Fonseca 2017-08-04 13:54:50 UTC
I got the same error using the sample project provided by @Ilnur, in the first swipe I got the same error. I'm using a ASUS K012 Android Version 4.3. Ony 1 GB of RAM. I also tested it with a LG G4 (API 23 model LG-H818) with 3GB RAM and the same problem occurs.

Only Trajan gives me the problem though. the OLD and NEW implementation (bridge-implementation=new) works fine. I think that it would be advisable to use the "new" implementation if someone need this workaround, it seems much faster: https://blog.xamarin.com/xamarin-android-garbage-collection-improvements/
Comment 8 Israel Fonseca 2017-08-04 14:10:42 UTC
I forgot to show my environment in the last comment:
MacOS Sierra 10.12.5
Visual Studio For Mac (Community) 7.0.1 (Build 24)
Mono 5.0.1.1
Comment 9 Ilnur 2017-08-04 14:49:25 UTC
@Israel Fonseca, you are absolutely right in advising the using the "new" implementation. I totally forgot about it.
Tested 200 swipes with the "new" on Samsung GT-N7100 (API 18) - runs fine.

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