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

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

Closed
jakobbotsch opened this issue Feb 14, 2022 · 6 comments
Assignees
Labels
arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

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

@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Feb 14, 2022
@ghost
Copy link

ghost commented Feb 14, 2022

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

Issue Details

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

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Feb 14, 2022

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

@BruceForstall
Copy link
Member

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

@BruceForstall BruceForstall added this to the 7.0.0 milestone Feb 15, 2022
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label Feb 15, 2022
@EgorBo
Copy link
Member

EgorBo commented Feb 15, 2022

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

@EgorBo
Copy link
Member

EgorBo commented Feb 15, 2022

Filed #65395

@BruceForstall
Copy link
Member

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.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

3 participants