Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

MediaType.GetHashCode() throws System.ExecutionEngineException #7673

Closed
austindrenski opened this issue Apr 17, 2018 · 5 comments
Closed

MediaType.GetHashCode() throws System.ExecutionEngineException #7673

austindrenski opened this issue Apr 17, 2018 · 5 comments
Assignees
Labels

Comments

@austindrenski
Copy link

MediaType.GetHashCode() throws a System.ExecutionEngineException in an ASP.NET Core application.

I've included a minimal project that consistently reproduces the exception on my local machine.

Does anyone have an idea of what's behind this?

Program.cs:

using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Formatters;

namespace test
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            MediaType t = new MediaType("text/csv");

            // throws => System.ExecutionEngineException
            Console.WriteLine(t.GetHashCode());

            WebHost.CreateDefaultBuilder(args)
                   .Build()
                   .Run();
        }
    }
}

test.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
  </ItemGroup>

</Project>
@mkArtakMSFT
Copy link
Member

Thanks for reporting this issue.
@dougbu, can you please look into this?

@jkotas
Copy link

jkotas commented Apr 18, 2018

This was CoreCLR bug. It was fixed for 2.1 as side-effect of dotnet/coreclr#16550.

@dougbu
Copy link
Member

dougbu commented Apr 18, 2018

Thanks @jkotas !

@austindrenski because this is a closed issue in the Core CLR, I'm marking this as external and closing it. You may want to watch dotnet/coreclr#16545 to see if it is reopened or otherwise added to a 2.0.x patch release.

@jkotas
Copy link

jkotas commented Apr 18, 2018

This issue was moved to dotnet/coreclr#17661

@austindrenski
Copy link
Author

Very much appreciated, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants