Bug 28905 - [XVS.iOS 3.9 SR4] Attempting to set constraint priority causes crash due to NRE in "ConstraintPriorityPropertyEntry.spinButton_OnValueChanged()"
Summary: [XVS.iOS 3.9 SR4] Attempting to set constraint priority causes crash due to N...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 3.9
Hardware: PC Windows
: High critical
Target Milestone: 3.11
Assignee: Jose Gallardo
URL:
Depends on:
Blocks:
 
Reported: 2015-04-08 17:45 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-04-14 10:03 UTC (History)
8 users (show)

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


Attachments
Screen capture of the problem (2.00 MB, application/x-shockwave-flash)
2015-04-08 17:45 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Log files (52.15 KB, application/zip)
2015-04-08 17:46 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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 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 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-08 17:45:57 UTC
Created attachment 10682 [details]
Screen capture of the problem

[XVS.iOS 3.9 SR4] Attempting to set constraint priority causes crash due to NRE in "ConstraintPriorityPropertyEntry.spinButton_OnValueChanged()"




## Regressions status: REGRESSION somewhere between XamarinVS 3.9.483 and XamarinVS 3.9.533

BAD:   Xamarin   3.11.271  (e36ba35) + Xamarin.iOS 8.10.0.197 (4dac6bf)
BAD:   Xamarin   3.9.533   (66489f0) + Xamarin.iOS 8.8.2.4    (981acb3)
GOOD:  Xamarin   3.9.483.0 (978be3d) + Xamarin.iOS 8.8.0.2    (ccfcd59) 




## Steps to reproduce

1. Create a new Unified, iPhone, Single View application in Visual Studio.


2. Open "MainStoryboard.storyboard" in the designer.


3. Drag a UIButton from "Views -> Toolbox" into the View Controller.


4. With the UIButton in the view controller selected, click the green "plus" button in the iOS designer toolbar to add the recommended constraints.


5. Single-click the UIButton twice to enter constraints editing mode (do not double-click).


6. Drag a new constraint from the top of the button to the top of the view controller.


7. Select either of the duplicate constraints from the top of the button to the top of the view controller.


8. Change the length of the constraint to a different value using the "Properties -> Widget" window.


9. Lower the priority of the constraint to "900".


10. Click back in the iOS designer canvas (or anywhere else outside the priority text entry field).


Note: steps 6-10 are also demonstrated in the attached screen capture.




## Results

Visual Studio crashes.


### Excerpt from the top of the stack trace (collected by attaching a second instance Visual Studio to the original instance for debugging)

> System.NullReferenceException was unhandled
> Message: An unhandled exception of type 'System.NullReferenceException' occurred in WindowsBase.dll
> Additional information: Object reference not set to an instance of an object.
>    at MonoTouch.Design.Client.Windows.ConstraintPriorityPropertyEntry.spinButton_OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
>    at MonoTouch.Design.Client.Windows.SpinButton.SetStringValue()
>    at MonoTouch.Design.Client.Windows.SpinButton.textBox_TextCommitted(Object sender, EventArgs e)




## Version information

### Windows 8.1 64-bit, in VMWare Fusion 6.0.5 (2209127)
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.11.271.0 (e36ba35)
Xamarin.Android   5.1.0.99 (e81edcfee3152b5892337b8741d8da28f9ee74b1)
Xamarin.iOS   8.10.0.0 (3abf86b113ef9dd7c6aaf53c4c47bdb39ae526b9)


### OS X 10.9.5, MacBook Air
Xamarin.iOS 8.10.0.197 (Business Edition)
Hash: 4dac6bf
Branch: master
Build date: 2015-04-01 21:55:11-0400

Mono 4.0.0 ((detached/21d849b)

Xcode 6.1.1 (6611), Build 6A2008a
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-08 17:46:52 UTC
Created attachment 10683 [details]
Log files
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-08 18:07:19 UTC
Note: Xamarin Studio 5.9 on Mac does _not_ hit this bug.


I suspect bug 28782 might have the same underlying cause.
Comment 4 PJ 2015-04-13 10:04:26 UTC
Thanks Jose! I think the commit in comment 3 still needs to be bumped to in XamarinVS.
Comment 5 PJ 2015-04-13 10:05:20 UTC
Also merged to xvs-cycle5.
Comment 6 Ben Beckley 2015-04-13 18:58:27 UTC
This is verified to be fixed in XVS 5.0.571
Comment 7 Shruti 2015-04-14 05:42:52 UTC
I have checked this issue with master and C5 branch and observed that this issue is fixed in master branch(XVS 5.0.572)  but still exist in C5 branch(XVS 3.11.426). Detailed Observation is given below :

Master Branch : VS is not getting crashed after following steps given in Comment(0). 
Screencast regarding same :  http://www.screencast.com/t/E0prDHjdTfaF
Environment Info : https://gist.github.com/Shruti360/af6e682c86bc2c7c231b

C5 Release Branch : VS is still getting crashed after following steps given in Comment(0). 
Screencast regarding same : http://www.screencast.com/t/mGe9LM52Pb
Environment Info : https://gist.github.com/Shruti360/8af0a426ae29567b9b8b
Comment 9 Alan McGovern 2015-04-14 06:20:07 UTC
The fix was just merged to the release branch. We just need VS to trigger a build with the fixes included :)
Comment 10 Shruti 2015-04-14 10:03:05 UTC
I have  checked this issue with C5 XVS 3.11.428 and observed that VS is not getting crash after following steps given in Comment(0). 

Screencast regarding same :  http://www.screencast.com/t/SswHuIoyM

Environment Info : https://gist.github.com/Shruti360/636773fdb8ed8cad361f

Hence, Closing this issue.