Assertions are no longer logged or detected in the default scenario

Open
#326 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
compilers, tooling

Research direction

Start with assertion detection in src/pmi/PMIDriver.cs lines 214-267, then inspect the linked runtime paths in src/coreclr/jit/error.cpp and src/coreclr/vm/jitinterface.cpp. Reproduce with jit-diff.bat diff --diff --pmi after building both repositories. Done means assertions are logged in the default scenario and PMIDriver detects the current assertion format.

Written by the indexing model from the issue text.

Description

Issue

The assertion detecting logic in PMIDriver (https://github.com/dotnet/jitutils/blob/945715f07ce9c4381b3ab199f2cd52b586a89415/src/pmi/PMIDriver.cs#L214-L267) is no longer correct for what the JIT currently outputs.

Additionally, due to other changes in the JIT, assertions are never logged in the default scenario.

Repro
  1. Clone dotnet/runtime
  2. Build the repo in all required configurations
  3. Clone dotnet/jitutils
  4. Build the repo using .\bootstrap.cmd
  5. In the dotnet/runtime root, run jit-diff.bat diff --diff --pmi

Observe that the command fails due to https://github.com/dotnet/runtime/issues/51728. However, System.Private.Corelib.err reports: General error, no assert seen.

Analysis

assertAbort (https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/error.cpp#L277-L323) currently fails to log anything because COMPlus_JitFuncInfoLogFile is not set and because the default CoreCLR.dll (VM) for the PMI diffs is release which means CEEInfo::doAssert does not actually print anything: https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/jitinterface.cpp#L10897-L10925

Additionally, even if the assertions are printed, they currently resemble:

Encoding:GetCharsWithFallback(long,int,long,int,int,int):int:this - Assertion failed (C:\Users\tagoo\Source\repos\runtime_base\src\coreclr\jit\emitxarch.cpp:11739 - ((regMask & emitThisGCrefRegs) && (ins == INS_add)) || ((regMask & emitThisByrefRegs) && (ins == INS_add || ins == INS_sub))) during Emit code

While the PMIDriver is currently looking for ]): Assertion failed ' and Assert failure(PID , neither of which are used by this failure path.

Dominant language
C#
Stars
161
Forks
69
Avg merge
1h 56m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/jitutils

All issues in dotnet/jitutils

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.