Bug 4115 - Generate Equality Members causes MonoDevelop to crash
Summary: Generate Equality Members causes MonoDevelop to crash
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.8.8.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-03-27 17:09 UTC by Alex Corrado [MSFT]
Modified: 2015-08-20 03:24 UTC (History)
1 user (show)

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


Attachments
Source file to repro this bug (1.06 KB, application/octet-stream)
2012-03-27 17:09 UTC, Alex Corrado [MSFT]
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 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:
RESOLVED FIXED

Description Alex Corrado [MSFT] 2012-03-27 17:09:47 UTC
Created attachment 1584 [details]
Source file to repro this bug

In MD 2.8.8.3, to reproduce:

1. Open the attached .cs file in MD.
2. Put the caret inside the class and choose Edit -> Show Code Generation Window.
3. Select "Equality members" and check both properties.
4. Hit enter

The following exception appears in the crash reporter window:

System.ArgumentException: Node is already used in another tree.
Parameter name: child
  at ICSharpCode.NRefactory.CSharp.AstNode.AddChild[Expression] (ICSharpCode.NRefactory.CSharp.Expression child, ICSharpCode.NRefactory.Role`1 role) [0x00072] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/contrib/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs:244 
  at ICSharpCode.NRefactory.CSharp.MemberReferenceExpression..ctor (ICSharpCode.NRefactory.CSharp.Expression target, System.String memberName, IEnumerable`1 arguments) [0x00006] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/contrib/ICSharpCode.NRefactory/CSharp/Ast/Expressions/MemberReferenceExpression.cs:77 
  at MonoDevelop.CodeGeneration.EqualityMembersGenerator+CreateEquality+<GenerateCode>c__IteratorA.MoveNext () [0x002da] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:128 
  at MonoDevelop.CodeGeneration.AbstractGenerateAction.GenerateCode () [0x00107] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:122 
  at MonoDevelop.CodeGeneration.GenerateCodeWindow.<GenerateCodeWindow>m__3 (System.Object , System.EventArgs ) [0x0000b] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:99 
  at MonoDevelop.CodeGeneration.GenerateCodeWindow+CustomTreeView.OnSubmit (System.EventArgs e) [0x0000b] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:59 
  at MonoDevelop.CodeGeneration.GenerateCodeWindow+CustomTreeView.OnKeyPressEvent (Gdk.EventKey evnt) [0x00020] in /Users/builder/data/lanes/monodevelop-mac-2.8.8.3/36818e1e/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:46 
  at Gtk.Widget.keypressevent_cb (IntPtr widget, IntPtr evnt) [0x00000] in <filename unknown>:0
Comment 1 Mike Krüger 2012-03-29 11:16:21 UTC
Fixed that one.
(In the newresolver branch)