Skip to content

CLR throws InvalidProgramException when a class contains a single static Vector<byte> field #17395

@cesarblum

Description

@cesarblum

Happens on full CLR only.

Repro:

using System.Numerics;

namespace VectorRepro
{
    public class Program
    {
        static Vector<byte> _vector = new Vector<byte>(42);
        //static Vector<byte> _vector2 = new Vector<byte>(43);

        public static void Main(string[] args)
        {
        }
    }
}

Error:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'VectorRepro.Program' threw an exception. ---> System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at VectorRepro.Program..cctor()
   --- End of inner exception stack trace ---
   at VectorRepro.Program.Main(String[] args)

If you uncomment the second static field, no error is thrown.

Other remarks:

Metadata

Metadata

Assignees

Labels

tenet-reliabilityReliability/stability related issue (stress, load problems, etc.)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions