Skip to content
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

Sorry we crashed while openning an assembly #3363

Open
greenozon opened this issue Jan 8, 2025 · 6 comments
Open

Sorry we crashed while openning an assembly #3363

greenozon opened this issue Jan 8, 2025 · 6 comments
Labels

Comments

@greenozon
Copy link

Steps to reproduce

  1. Try to open up assembly (it's protected, yes, but crash is not expected, just error message!)

Error message shown

System.BadImageFormatException: Row ID or heap offset is too large.
   at System.Reflection.Throw.ReferenceOverflow()
   at System.Reflection.Metadata.TypeDefinition.get_Name()
   at ICSharpCode.Decompiler.Metadata.MetadataFile.GetTypeDefinition(TopLevelTypeName typeName) in /_/ICSharpCode.Decompiler/Metadata/MetadataFile.cs:line 183
   at ICSharpCode.Decompiler.TypeSystem.DecompilerTypeSystem.<>c__DisplayClass10_0.<InitializeAsync>g__IsMissing|2(KnownTypeReference knownType) in /_/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs:line 392
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at ICSharpCode.Decompiler.TypeSystem.DecompilerTypeSystem.InitializeAsync(MetadataFile mainModule, IAssemblyResolver assemblyResolver, TypeSystemOptions typeSystemOptions) in /_/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs:line 359
   at ICSharpCode.Decompiler.TypeSystem.DecompilerTypeSystem..ctor(MetadataFile mainModule, IAssemblyResolver assemblyResolver, TypeSystemOptions typeSystemOptions) in /_/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs:line 235
   at ICSharpCode.Decompiler.TypeSystem.DecompilerTypeSystem..ctor(MetadataFile mainModule, IAssemblyResolver assemblyResolver, DecompilerSettings settings) in /_/ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs:line 225
   at ICSharpCode.ILSpy.CSharpLanguage.DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options)
   at ICSharpCode.ILSpy.TreeNodes.AssemblyTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options)

image

Expectations: show only text error, remove strange mesage box

Details

  • Product in use: ILSpy version 9.0.0.7876-RC+ee6d939478a40eb944c614c2b3b618e245665ec3
    .NET version 8.0.11+9cb3b725e3ad2b57ddc9fb2dd48d2d170563a8f5
@greenozon greenozon added the Bug label Jan 8, 2025
@siegfriedpammer
Copy link
Member

Did you forget to attach the assembly?

@greenozon
Copy link
Author

greenozon commented Jan 8, 2025

yeah, sorry

https://www.sendspace.com/file/9waqnp

@siegfriedpammer
Copy link
Member

password-protected rar?

@greenozon
Copy link
Author

pardon me, my mistake
link fixed (above)

@siegfriedpammer
Copy link
Member

The assembly is completely broken, even after somewhat gracefully handling the invalid handles into the String heap, ILSpy is unable to decode/show any method body, because the method body headers are invalid. What would you expect us to do?

@greenozon
Copy link
Author

just dont show the "we crashed" dialog, it is very scary
the error text on the right pane is enough! :)

PS hte assembly is still workable and runnable

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

No branches or pull requests

2 participants