Skip to content

Assertion failed '(emitThisGCrefRegs & regMask) == 0' during 'Emit code' (IL size 129) #65311

Closed

Description

@jakobbotsch

Description

The following program hits a JIT assert on win-x86.

Reproduction Steps

// Generated by Fuzzlyn v1.5 on 2022-02-13 16:58:00
// Run on X86 Windows
// Seed: 17417076199071509021
// Reduced from 70.5 KiB to 0.7 KiB in 00:02:32
// Hits JIT assert in Release:
// Assertion failed '(emitThisGCrefRegs & regMask) == 0' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Emit code' (IL size 129)
// 
//     File: D:\a\_work\1\s\src\coreclr\jit\emitxarch.cpp Line: 12182
// 
public class C0
{
    public int F1;
    public short F2;
}

public class Program
{
    public static long s_1;
    public static C0 s_3;
    public static void Main()
    {
        bool vr0 = default(bool);
        s_3.F2 = s_3.F2++;
        if (!vr0)
        {
            if (vr0)
            {
                vr0 = s_3.F2 <= s_3.F1;
                short vr2 = (short)s_1;
                sbyte vr1 = (sbyte)vr2;
                try
                {
                    vr1 >>= s_3.F1;
                }
                finally
                {
                    vr0 = vr0;
                }

                System.Console.WriteLine(vr1);
            }
        }

        System.Console.WriteLine(vr0);
    }
}

Expected behavior

No assert hit.

Actual behavior

Assert hit.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Feb 14, 2022
  2. ghost added
    untriaged
    on Feb 14, 2022
  3. EgorBo commented on Feb 14, 2022

    @EgorBo
    Member

    I've verified that it's not "fix too wide nullchecks" related

  4. BruceForstall commented on Feb 15, 2022

    @BruceForstall
    Contributor

    @EgorBo The issues you closed as "dup" are a different assert; is it the same issue?

  5. added this to the 7.0.0 milestone on Feb 15, 2022
  6. removed
    untriaged
    on Feb 15, 2022
  7. EgorBo commented on Feb 15, 2022

    @EgorBo
    Member

    @BruceForstall oops, indeed, the assert text looks similar but not the same, I'll re-open one of them

  8. EgorBo commented on Feb 15, 2022

    @EgorBo
    Member

    Filed #65395

  9. BruceForstall commented on Aug 10, 2022

    @BruceForstall
    Contributor

    I can't repro this. I'm going to presume it was fixed in the last 6 months.

    It does repro in .NET 6, but doesn't appear to justify a .NET 6 servicing fix.

  10. ghost locked as resolved and limited conversation to collaborators on Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-x86area-CodeGen-coreclr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions