Today, I saw a press release in the garden. NET 4.6 Ryujit compiler found a serious bug mentioned in the. NET 4.6 x64 program to enable the new JIT program by default Ryujit when processing the tail recursion instruction, there is a bug, resulting in not getting the correct results.
Microsoft has introduced this bug in more detail in its official Blogryujit bug advisory in the. NET Framework 4.6. Although the tail recursion is not used much (seemingly there are many applications in F #), the bug is more serious:
- This problem only occurs when code optimization is applied, since most developers and projects are developed in DEBUG mode and therefore not visible in the local environment.
- Even if this problem is discovered, once the debugger is attached to the process, it will change its behavior, which almost makes the problem completely invisible.
There are three different options for this bug:
- Continue to use. NET 4.5 without using. NET 4.6
- Disable Ryujit .
- Disable tail recursion optimization
In these three ways, although Method 2 and Method 3 can solve this bug with. NET 4.6, it is important to note that because this is a bug in. NET 4.6, and JIT is a local behavior, it needs to be applied on all machines that execute your program. Add this bug is very vague, not immediately error, error does not necessarily know is the fault here. These two types of modifications are really difficult to implement.
In addition, in another blog mentioned several. Net 4.6 of several bug:http://nickcraver.com/blog/2015/07/27/why-you-should-wait-on-dotnet-46/, it seems, The use of. Net 4.6 In a production environment has to be weighed.
Ryujit tail recursive optimization bug for. NET 4.6