Bug 35479 - Designer crashes on double-click of a resize handle
Summary: Designer crashes on double-click of a resize handle
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Designer ()
Version: 5.10 (C6SR3)
Hardware: Macintosh Mac OS
: High critical
Target Milestone: 5.10 (C6)
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2015-11-02 20:49 UTC by Mark McLemore
Modified: 2015-11-09 06:13 UTC (History)
6 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Mark McLemore 2015-11-02 20:49:48 UTC
When I double-click the circular resize-handle (arbitrary dp size), the Designer crashes with the following stack trace (below). It takes about three tries, and it appears to be readily reproducible. The app is the template "hello, world click me" template app with Device = Nexus 4, Version = Android 6.0 (v23), and the Default Theme. I'm double-clicking the left resize handle on the Button widget.

Environment:
Xamarin Studio Version 5.10 (build 860).


Stack trace:

System.NullReferenceException: Object reference not set to an instance of an object
   at Xamarin.Designer.VisualItem.set_Designer (Xamarin.Designer.DesignerSurface value) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/Xamarin.Designer/Xamarin.Designer/VisualItem.cs:line 459
   at Xamarin.Designer.DesignerSurface.OnVisualItemRemoved (Xamarin.Designer.VisualItem item) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/Xamarin.Designer/Xamarin.Designer/DesignerSurface.cs:line 1642
   at Xamarin.Designer.DesignerSurface.RemoveVisualItem (Xamarin.Designer.VisualItem item, Boolean refreshWorldRect) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/Xamarin.Designer/Xamarin.Designer/DesignerSurface.cs:line 1578
   at Xamarin.Designer.DesignerSurface.RemoveVisualItems (IEnumerable`1 items) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/Xamarin.Designer/Xamarin.Designer/DesignerSurface.cs:line 1629
   at Xamarin.Designer.DesignerSurface.UpdateSelectionHandles () in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/Xamarin.Designer/Xamarin.Designer/DesignerSurface.cs:line 2078
   at Xamarin.AndroidDesigner.AndroidDesignerSurface.HandleSessionImageChanged (System.Object sender, System.EventArgs e) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidDesignerSurface.cs:line 207
   at Xamarin.AndroidDesigner.AndroidDesignerSession.OnImageChanged () in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidDesignerSession.cs:line 1791
   at Xamarin.AndroidDesigner.AndroidDesignerSession.HandleImageChanged (System.Object sender, System.EventArgs e) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidDesignerSession.cs:line 912
   at Xamarin.AndroidDesigner.AndroidRenderSession.OnImageChanged () in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidRenderSession.cs:line 799
   at Xamarin.AndroidDesigner.AndroidRenderSession.FinishRefresh (Xamarin.AndroidDesigner.RenderData newRoot, System.IO.MemoryStream ms, Boolean asyncRefresh) in /Users/builder/data/lanes/2103/7c46a0b7/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/AndroidRenderSession.cs:line 685
Comment 1 Mark McLemore 2015-11-02 20:51:35 UTC
Correction, I'm clicking the *left* circular resize handle.
Comment 2 Mark McLemore 2015-11-02 20:54:01 UTC
Correction, I'm clicking the *right* circular resize handle while the button is in match_parent mode. When I click the circular resize handle while the button is in wrap_content mode (moved to the left), I'm not getting the crash.
Comment 3 Sadik Ali 2015-11-03 08:17:59 UTC
I have checked this issue and able to reproduce the above behavior given in the bug description. When I double click on resize handle then designer crashes with "System.NullReferenceException" exception.

Screencast: http://www.screencast.com/t/nmS3yBBsqZy
Ide Logs:  https://gist.github.com/Rajneesh360Logica/3bca1a3cb744c7eb8296

Regression Status: REGRESSION-Working fine with XS 5.9.8.0 . I have double clicked multiple times but Android Designer does not crash.

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

Environment Info: 

=== Xamarin Studio ===

Version 5.10 (build 860)
Installation UUID: 2591d519-875d-4afe-a3d9-5fcf391bbd2d
Runtime:
	Mono 4.2.1 (explicit/110fdd8)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010092

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.iOS ===

Version: 9.2.1.21 (Trial Edition)
Hash: 9ce9e8b
Branch: master
Build date: 2015-10-28 19:11:03-0400

=== Xamarin.Android ===

Version: 6.0.0.28 (Trial Edition)
Android SDK: /Users/nischal/Desktop/sdkndk/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

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

=== Xamarin.Mac ===

Version: 2.5.0.2016 (Starter Edition)

=== Build Information ===

Release ID: 510000860
Git revision: 7c46a0b709d51ad5d5a5ed90a4671cc7b6928e62
Build date: 2015-10-29 17:17:52-04
Xamarin addins: b9337905aca5dc276190d78819728a59cda33a43
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.10.5
Darwin nischals-Mac-mini.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 5 Jérémie Laval 2015-11-03 14:03:54 UTC
This is a regression introduced by commit https://github.com/xamarin/md-addins/commit/4d37417348bac93ac19a0f6c7af9189ecab4f5d7

Alan: does it just need more null-check or is it papering over something else?
Comment 6 Jérémie Laval 2015-11-03 14:51:10 UTC
I haven't been able to reproduce this issue (see system information below). I'm using a more recent 4.2 Mono and I'm on El Capitan (not that it should make much of a difference).

The screencast seems to show the handles slightly shifting before the crash happens so it may just be that what I do doesn't trigger this.

I will continue to see if I can check this unless Alan can reproduce the problem.
Comment 7 Jérémie Laval 2015-11-03 14:52:08 UTC
=== Xamarin Studio ===

Version 5.10
Installation UUID: b75f4250-f49f-45f1-9965-20849459a96e
Runtime:
	Mono 4.2.1 (explicit/5a86dd3 Mon Nov  2 22:59:28 EST 2015)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010098

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.iOS ===

Version: 9.0.1.20 (Business Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

=== Xamarin.Android ===

Version: 6.0.0.18 (Business Edition)
Android SDK: /Users/jeremie/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

=== Xamarin Android Player ===

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

=== Xamarin.Mac ===

Version: 2.3.0.131 (Business Edition)

=== Build Information ===

0153a1e5b3f1f4d25b503265e232eb9b49633930
Xamarin addins: 324393d2c1dea5192ded0b45497691f404538e3d

=== Operating System ===

Mac OS X 10.11.1
Darwin garuda 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 8 Jérémie Laval 2015-11-03 16:13:09 UTC
I worked around the issue with https://github.com/xamarin/md-addins/commit/511592f767ac9cc0de484b6ae20a0498f652d33f but I would like Alan's opinion on it cause it might cause more harm (see commit description).

In terms of Cycle 6, the original proposal of simply adding null-checks might be a better idea.
Comment 9 xamarin-release-manager 2015-11-04 13:17:14 UTC
Fixed in version 5.11.0.397 (master)

Author: J??r??mie Laval
Commit: 511592f767ac9cc0de484b6ae20a0498f652d33f (xamarin/md-addins)
Included in Commit: 2405aa0e7f7909e9d33ae0c21a62399d781c8c9e (mono/monodevelop)
Comment 10 Sadik Ali 2015-11-05 05:21:52 UTC
I have checked this issue with latest master build i.e
XamarinStudio-5.11.0.397_2405aa0e7f7909e9d33ae0c21a62399d781c8c9e and this issue is working fine.

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

I also checked this issue with md-addins master build i.e
XamarinStudio-5.11.0.397_6832f99277c1d6e5f6112b6ae1c228fc7a5a93d8 and this issue is working fine.

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

As per Target Milestone this issue is fixed in master builds, so I am not closing this issue right now. Once this issue will be fixed in C6 build then I will close this issue with C6 build.
Comment 11 xamarin-release-manager 2015-11-06 11:15:23 UTC
Fixed in version 5.10.0.866 (cycle6)

Author: J??r??mie Laval
Commit: 445c874566cc224d3e2afc5882bee40bc49370c7 (xamarin/md-addins)
Included in Commit: 4892aaf8bcc13a72a9e19d1955b8e7dc34d9b63e (mono/monodevelop)
Comment 12 Sadik Ali 2015-11-09 06:13:08 UTC
I have checked this issue with Cycle6 build i.e
XamarinStudio-5.10.0.866_4892aaf8bcc13a72a9e19d1955b8e7dc34d9b63e and now this issue is working fine.

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

Hence I am closing this issue.