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

ILVerify fails with non-actionable uncaught exception on specific (possibly corrupt?) DLL #109037

Closed
kg opened this issue Oct 19, 2024 · 2 comments
Labels
area-ILVerification help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@kg
Copy link
Member

kg commented Oct 19, 2024

Description

I'm investigating an error that only occurs in checked builds of the runtime, where Something is wrong with a managed binary, but I'm not sure what.

dotnet-ilverify is of no use here because it just throws an unhandled exception early in execution when passed this dll.

Reproduction Steps

ilverify.exe mcc_i06.dll
You can also ilverify.exe --verbose -t mcc_i06.dll for a different failure
mcc_i06.zip

Expected behavior

Verification results or diagnostic messages

Actual behavior

PS E:\desktop> ilverify --verbose .\mcc_i06.dll

Using input file 'E:\desktop\mcc_i06.dll'

Error: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at ILVerify.Program..ctor(ILVerifyRootCommand command)
   at ILVerify.ILVerifyRootCommand.<.ctor>b__40_0(ParseResult result)
PS E:\desktop> ilverify .\mcc_i06.dll
Error: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at ILVerify.Program.Resolve(String simpleName)
   at ILVerify.Program.ILVerify.IResolver.ResolveAssembly(AssemblyName assemblyName)
   at ILVerify.Verifier.SetSystemModuleName(AssemblyName name)
   at ILVerify.Program.Run()
   at ILVerify.ILVerifyRootCommand.<.ctor>b__40_0(ParseResult result)

Regression?

No response

Known Workarounds

No response

Configuration

PS E:\desktop> dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

PS E:\desktop> dotnet tool install -g dotnet-ilverify
Tool 'dotnet-ilverify' was reinstalled with the stable version (version '8.0.0').

Other information

ILSpy sees nothing wrong with this file, but classic PEVerify says something is wrong with one of the structs. Not sure if that's true or not.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Oct 19, 2024
@jkotas jkotas added help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels Oct 19, 2024
@jkotas jkotas added this to the Future milestone Oct 19, 2024
@MichalPetryka
Copy link
Contributor

MichalPetryka commented Oct 19, 2024

This exception happens if it can't find mscorlib/SPC in your working directory IIRC reference list. You must pass a path with it with -r.

@jkotas
Copy link
Member

jkotas commented Oct 19, 2024

This is duplicate of #103154, fixed for .NET 9.

The output in .NET 9 is:

>ilverify mcc_i06.dll
Error: Assembly or module not found: mscorlib
Internal.IL.VerifierException: Assembly or module not found: mscorlib

@jkotas jkotas closed this as completed Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ILVerification help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

3 participants