Skip to content

Add ilverify --list-errors to list the names --ignore-error matches - #136112

Merged
jkotas merged 1 commit into
dotnet:mainfrom
pcshrosbree:ilverify/list-error-names
Oct 20, 2026
Merged

jkotas merged 1 commit into
dotnet:mainfrom
pcshrosbree:ilverify/list-error-names

Conversation

@pcshrosbree

Copy link
Copy Markdown
Contributor

--ignore-error and --ignore-error-file match regular expressions against error names, but ILVerify does not list those names anywhere. This PR adds a --list-errors option that prints them:

  • every VerifierError name except None, with its message from Strings.resx;
  • every ExceptionStringID name;
  • a line saying that an error with neither kind of name matches None.

The issue proposed --help --verbose for this. I used a separate option instead, which the issue offered as the alternative. Plain --help now shows the option with its own description, and --verbose keeps its one meaning, verbose verification output.

Like --help, --list-errors works without input files. If input files are given, it prints the list and does not verify them. Plain --help gains one line:

  --list-errors                            List the error names that --ignore-error matches

The output looks like this:

Verification errors (--ignore-error matches these names):
  UnknownOpcode: Unknown opcode.
  MethodFallthrough: Fall through end of the method without returning.
  ...
  UnalignedAlignment: Alignment specified for 'unaligned.' must be 1, 2, or 4.

Type system errors (--ignore-error also matches these names):
  ClassLoadGeneral
  ClassLoadExplicitGeneric
  ...
  AmbiguousMatchUnsafeAccessor

An error with neither kind of name, such as an exception while verifying a method, matches None.

Five messages contain placeholders such as '{0}', which ILVerify fills in when it reports the error. The list shows them unfilled.

Testing

ILVerify has no command-line tests, so I checked a build of this branch against a build of main:

  • --list-errors with no input files exits with 0. It prints 124 verification error names (all of VerifierError except None) and 25 type system names (all of ExceptionStringID). Both lists follow declaration order. Each verification error name is printed with its Strings.resx message.
  • Plain --help differs from main only by the new line.
  • --ignore-error accepts a name from each list. On the ReturnTests assembly from ILVerification.Tests, --ignore-error "^ReturnPtrToStack$" removed both ReturnPtrToStack errors and nothing else. On InvalidMetadataReferenceTests, --ignore-error "^ClassLoadGeneral$" removed the five ClassLoadGeneral errors.
  • ILVerification.Tests passes: 513 of 513.

Fixes #136056

Note

This PR was prepared with AI assistance (Anthropic Claude and OpenAI Codex), under my direction. I reviewed it before posting.

--ignore-error and --ignore-error-file match regular expressions
against error names, but ILVerify does not list those names anywhere.

The new --list-errors option prints every VerifierError name except
None, with each name's message from Strings.resx. It then prints every
ExceptionStringID name. A final line explains that an error with
neither kind of name matches None. Like --help, it works without input
files and does not verify any that are given.

Fixes dotnet#136056
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 19, 2026
@github-actions github-actions Bot added the area-Tools-ILVerification Issues related to ilverify tool and IL verification in general label Oct 19, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jkotas

jkotas commented Oct 20, 2026

Copy link
Copy Markdown
Member

/ba-g System.Runtime.Tests failure is known issue that just got fixed

@jkotas
jkotas merged commit 6ee7dd7 into dotnet:main Oct 20, 2026
110 of 112 checks passed
@pcshrosbree

Copy link
Copy Markdown
Contributor Author

Thank you for the review and merge!

@pcshrosbree
pcshrosbree deleted the ilverify/list-error-names branch October 20, 2026 04:41
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILVerification Issues related to ilverify tool and IL verification in general community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ILVerify: list the error names in ilverify --help --verbose?

2 participants