Bug 22271 - Stepping over breakpoints results in crash
Summary: Stepping over breakpoints results in crash
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.16.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2014-08-21 16:06 UTC by Allie Miller
Modified: 2014-09-23 08:34 UTC (History)
8 users (show)

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

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 or GitHub 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 Allie Miller 2014-08-21 16:06:28 UTC
*Steps to reproduce issue*
1) Open attached test project in Xamarin Studio
2) Run the Android application on either a device or emulator
3) Notice that the application does not crash.
4) After stopping the debugging session, set a few breakpoints in the project.
5) Deploy the application to the same device/emulator again.
6) When a breakpoint is hit, select F10/step-over 

*Expected Results*
Application continues to run as expected as originally observed without breakpoints.

*Actual Results*
Application crashes when attempting to step over.

*Additional Information*
Logs from Xamarin Studio attached. Test case marked as private in next comment.

*Versioning Information*
Windows 8

Xamarin Studio
Version 5.3 (build 427)
Installation UUID: e2d86500-eccf-4eef-8f5c-3fb5261a6457
Microsoft .NET 4.0.30319.34014
GTK+ 2.24.22 (MS-Windows theme)
GTK# 2.12.26

Version: 4.16.0 (Enterprise Edition)
Android SDK: C:\Program Files\adt-bundle-windows-x86_64-20131030\sdk
Supported Android versions:
2.2 (API level 8)
2.3 (API level 10)
3.0 (API level 11)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode)

Build Information
Release ID: 503000427
Git revision: b731d769195292820b25b6f9621a7a9decb3fff6
Build date: 2014-08-14 01:18:51-04
Xamarin addins: aaf33dfafebf0d688f6e1a1eb58bced21de89a1d

Operating System
Windows 6.2.9200.0 (64-bit)
Comment 3 Matt Cuda 2014-08-22 13:55:11 UTC
Also failing in Visual Studio plug-in.
Comment 4 Arpit Jha 2014-08-25 11:12:08 UTC
I have checked this issue and unable to reproduce it.

Attached project having build error.

Could you please provide us updated project.So that, I can able to reproduce it.

Screencast: http://screencast.com/t/8j6JNg9R87

Environment Info:
Comment 5 Matt Cuda 2014-08-25 11:14:27 UTC
What is your build error?  Allie was able to reproduce it right off and she isn't even in engineering.
Comment 6 Jeffrey Stedfast 2014-08-25 11:20:39 UTC
If the application is crashing, this is more likely to be a runtime issue so reassigning to the runtime team.
Comment 7 Matt Cuda 2014-08-25 11:24:11 UTC
The crash is caused by the debugger.  It isn't until you hit F10 that the app crashes and it doesn't matter where your break point is.
Comment 8 Zoltan Varga 2014-08-25 17:11:41 UTC
I get the following error when trying to build:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: You have Jar libraries, classes.jar, that have the identical name with inconsistent file contents. Please make sure to remove any conflicting libraries in EmbeddedJar, InputJar and AndroidJavaLibrary. (ECMDGearsForAndroid)

This could be due to different xs/x.android versions.
Comment 9 Matt Cuda 2014-08-25 17:19:07 UTC
This is easy enough to fix.  Just remove the current assembly which is referencing The android compat libraries in the project and replace them with whatever version of Xamarin you are using. Then recompile.
Comment 10 Zoltan Varga 2014-08-25 17:27:09 UTC
This is the android version of:

As a workaround, add the following method, and call it from somewhere:

using System.Diagnostics;

          void bug22271workaround () {
Comment 11 Zoltan Varga 2014-08-25 17:29:56 UTC
Should be fixed in monodroid c9994768623f745a7b01a320c27734128020a222.
Comment 12 Zoltan Varga 2014-08-25 17:30:09 UTC
Comment 13 Matt Cuda 2014-08-25 17:32:41 UTC
Wait a minute.  What is fixed?  The debugger not stepping over?
Comment 14 Zoltan Varga 2014-08-25 17:33:56 UTC
The crash when single stepping is fixed.
Comment 15 Akhilesh kumar 2014-09-23 08:34:45 UTC
I tried to reproduce this issue with XA 4.16.0 and followed steps mentioned in bug description but I am unable to reproduce this issue. Application does not crash on selecting 'Step-over'.

I have checked this issue with 5.5 (build 202) and XA 4.18.0, and I am getting same behavior.

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

Could you please suggest me how can I reproduce this issue? So that I can verify this issue more efficiently. 

=== Xamarin Studio ===

Version 5.5 (build 202)
Installation UUID: 3fc635c1-474b-4c42-80c0-e9f7eba65b3c
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.18.0 (Trial Edition)
Android SDK: F:\SDK\AndroidSDK
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 505000202
Git revision: db0094676d663e107944d57bd90f32aa1af6f61c
Build date: 2014-09-22 14:36:02-04
Xamarin addins: c31fea2f959659225466adef1c0793a8d7eebcef

=== Operating System ===

Windows 6.2.9200.0