.NET 4.6 Bug - Tail Call bug in RyuJIT - Quick Guid

UPDATE: Tail Call Bug has been fixed and here is the more details about it.
http://blogs.msdn.com/b/dotnet/archive/2015/07/28/ryujit-bug-advisory-in-the-net-framework-4-6.aspx


The following information has been collected from the below mentioned links and from my Friends.  This post is just a reference purpose and needs lot of testing to implement this solution.

Reference:

What is Tail Call?

Wonder full Blog post on Tail Call is here: 

Who should be worried about : 

-           .NET Framework 4.6 is installed on the machine running the application
-           The application targets the ‘Any CPU’ or ‘x64’ platform
-           The application targets the .NET 4.5 or .NET 4.6 framework (potentially even earlier .NET frameworks)
-           The CLR is running in 64-bit mode
-           Optimisations are enabled (i.e. the application is compiled in RELEASE configuration)
-           The application is running in IIS

Solution:

If you have already installed .NET 4.6, it is recommended to disable RyuJIT:

Via the registry:
Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
Add a useLegacyJit DWORD with a value of 1

Via Powershell:
Set-ItemProperty -Path HKLM:\Software\Microsoft\.NETFramework -Name useLegacyJit -Type DWord -Value 1

Sample Application to Test:


Note: When you download and open this application with .Net Version 4.5 or lesser then the following steps need to be applied to run the application.

In CorruptionRepro project

1. Web.config 

Under System.codedom -> Compilers -> Compiler -> CompilerOptions : Change the languageVersion:6 to languageVersion:5

2. Index.html

In Views -> Home -> Index.cshtml Line no:73
Change to
<td>@(test.RawSetDuration.HasValue ? test.RawSetDuration.ToString() : "(null)")</td>



Comments

Popular posts from this blog

Error : ID4243: Could not create a SecurityToken.

MVC - Looping through the model properties from cshtml