Skip to content

JIT crash caused by late GetType() optimizations  #33333

@jkotas

Description

@jkotas

Repro:

Compile and JIT w/ optimizations

using System;
using System.Runtime.CompilerServices;

sealed class Program
{
    [MethodImpl(MethodImplOptions.NoInlining)]
    public object M()
    {
        return GetType2() == typeof(Program) ? base.ToString() : ToString();
    }

    Type GetType2() => GetType();

    static void Main(string[] args)
    {
        new Program().M();
    }
}

Result:

Assert failure(PID 23416 [0x00005b78], Thread: 15036 [0x3abc]): Assertion failed 'OperIs(GT_NOP, GT_CALL, GT_COMMA) || OperIsCompare() || OperIsLong() || OperIsSIMD() || OperIsHWIntrinsic()' in 'Program:M():System.Object:this' during 'Lowering nodeinfo' (IL size 37)

Release build hits AV later

More context: dotnet/corert#6729 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbuguntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions