Skip to content

NullReferenceException in TypeNode.CleanExceptionSource when trying to compare assemblies #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
markusschaber opened this issue Apr 27, 2017 · 6 comments

Comments

@markusschaber
Copy link

markusschaber commented Apr 27, 2017

Hi,

I just wanted to test it on a "real world case" by comparing two assemblies, and get the following exception just before the end of the "Loading assembly 2 of 2" phase:

Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei JustAssembly.Nodes.TypeNode.CleanExceptionSource(IDecompilationResults decompilationResult, String sourceCode) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:Zeile 99.
   bei JustAssembly.Nodes.TypeNode.GetDifferenceDecoration() in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:Zeile 168.
   bei JustAssembly.Nodes.TypeNode..ctor(IOldToNewTupleMap`1 typesMap, ItemNodeBase parent, APIDiffInfo apiDiffInfo, FilterSettings filterSettings) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:Zeile 39.
   bei JustAssembly.Nodes.NamespaceNode.GenerateTypeNode(IOldToNewTupleMap`1 metadataTuple, LoadAPIItemsContext context) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\NamespaceNode.cs:Zeile 65.
   bei System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   bei System.Collections.ObjectModel.ObservableCollection`1.CopyFrom(IEnumerable`1 collection)
   bei JustAssembly.Nodes.NamespaceNode.LoadChildren() in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\NamespaceNode.cs:Zeile 47.
   bei ICSharpCode.TreeView.SharpTreeNode.EnsureLazyChildren()
   bei ICSharpCode.TreeView.SharpTreeNode.set_IsExpanded(Boolean value)
   bei JustAssembly.Nodes.ModuleNode.<>c__DisplayClass4.<LoadChildren>b__1(IGrouping`2 g) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\ModuleNode.cs:Zeile 53.
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei System.Collections.ObjectModel.ObservableCollection`1.CopyFrom(IEnumerable`1 collection)
   bei JustAssembly.Nodes.ModuleNode.LoadChildren() in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\ModuleNode.cs:Zeile 50.
   bei ICSharpCode.TreeView.SharpTreeNode.EnsureLazyChildren()
   bei ICSharpCode.TreeView.SharpTreeNode.set_IsExpanded(Boolean value)
   bei JustAssembly.Nodes.AssemblyNode.GenerateModuleNode(IOldToNewTupleMap`1 metadataTuple, LoadAPIItemsContext context, Boolean shouldBeExpanded) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:Zeile 272.
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   bei JustAssembly.Nodes.AssemblyNode.GetMergedModules(Boolean shouldBeExpanded) in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:Zeile 260.
   bei JustAssembly.Nodes.AssemblyNode.<>c__DisplayClass6.<LoadItemsAsync>b__3() in c:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:Zeile 181.

I attached a Zip archive containing the files in question.
LibCompare.zip

Thanks for your patience...

@cjohn93
Copy link

cjohn93 commented Jul 7, 2017

I pulled the latest code compiled and ran with your zip IronPython.dll files and everything is working correctly.

@bsivanov
Copy link
Member

The issue is still reproducible, for example when comparing v2.7.2 and v2.9.1 of DocumentFormat.OpenXML assemblies (net46 flavors).

It seems the error is in the UI when comparing members which have exceptions during decompilation.

@bsivanov bsivanov changed the title Exception when trying to compare assemblies NullReferenceException in TypeNode.CleanExceptionSource when trying to compare assemblies Nov 19, 2019
@bsivanov
Copy link
Member

And the call stack in English:

Object reference not set to an instance of an object.
   at JustAssembly.Nodes.TypeNode.CleanExceptionSource(IDecompilationResults decompilationResult, String sourceCode) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:line 99
   at JustAssembly.Nodes.TypeNode.GetDifferenceDecoration() in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:line 166
   at JustAssembly.Nodes.TypeNode..ctor(IOldToNewTupleMap`1 typesMap, ItemNodeBase parent, APIDiffInfo apiDiffInfo, FilterSettings filterSettings) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\TypeNode.cs:line 39
   at JustAssembly.Nodes.NamespaceNode.GenerateTypeNode(IOldToNewTupleMap`1 metadataTuple, LoadAPIItemsContext context) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\NamespaceNode.cs:line 65
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.ObjectModel.ObservableCollection`1.CopyFrom(IEnumerable`1 collection)
   at JustAssembly.Nodes.NamespaceNode.LoadChildren() in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\NamespaceNode.cs:line 47
   at ICSharpCode.TreeView.SharpTreeNode.EnsureLazyChildren()
   at ICSharpCode.TreeView.SharpTreeNode.set_IsExpanded(Boolean value)
   at JustAssembly.Nodes.ModuleNode.<>c__DisplayClass8_0.<LoadChildren>b__1(IGrouping`2 g) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\ModuleNode.cs:line 53
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.ObjectModel.ObservableCollection`1.CopyFrom(IEnumerable`1 collection)
   at JustAssembly.Nodes.ModuleNode.LoadChildren() in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\ModuleNode.cs:line 50
   at ICSharpCode.TreeView.SharpTreeNode.EnsureLazyChildren()
   at ICSharpCode.TreeView.SharpTreeNode.set_IsExpanded(Boolean value)
   at JustAssembly.Nodes.AssemblyNode.GenerateModuleNode(IOldToNewTupleMap`1 metadataTuple, LoadAPIItemsContext context, Boolean shouldBeExpanded) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:line 315
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at JustAssembly.Nodes.AssemblyNode.GetMergedModules(Boolean shouldBeExpanded) in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:line 303
   at JustAssembly.Nodes.AssemblyNode.<>c__DisplayClass29_0.<LoadItemsAsync>b__1() in C:\Jenkins\ReleaseFullWithUploadBuild\workspace\UI\JustAssembly\Nodes\AssemblyNode.cs:line 194

@AKrasheninnikov
Copy link

Thank you @bsivanov I'm gonna watch this

@bsivanov
Copy link
Member

Probably #57 is duplicate of this one.

@Alloc86
Copy link

Alloc86 commented Mar 27, 2021

Just ran across this too. I suppose there hasn't been any fix or workaround yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants