.NET 4.6 Optimizer Bug Causes Methods To Get Wrong Parameters
tobiasly writes: A serious bug in the just-released .NET 4.6 runtime causes the JIT compiler to generate incorrectly-optimized code which results in methods getting called with different parameters than what were passed in. Nick Craver of Stack Exchange has an excellent write-up of the technical details and temporary workarounds; Microsoft has acknowledged the problem and submitted an as-yet unreleased patch.
This problem is compounded by Microsoft's policy of replacing the existing .NET runtime, as opposed to the side-by-side runtimes which were possible until .NET 2.0. This means that even if your project targets .NET 4.5, it will get the 4.6 runtime if it was installed on that machine. Since it's not possible to install the just-released Visual Studio 2015 without .NET 4.6, this means developers must make the difficult choice between using the latest tools or risking crippling bugs such as this one.
This problem is compounded by Microsoft's policy of replacing the existing .NET runtime, as opposed to the side-by-side runtimes which were possible until .NET 2.0. This means that even if your project targets .NET 4.5, it will get the 4.6 runtime if it was installed on that machine. Since it's not possible to install the just-released Visual Studio 2015 without .NET 4.6, this means developers must make the difficult choice between using the latest tools or risking crippling bugs such as this one.
Since it's not possible to install the just-released Visual Studio 2015 without .NET 4.6, this means developers must make the difficult choice between using the latest tools or risking crippling bugs such as this one.
If you're a dev, you shouldn't be chasing versions. Find a stable version, stick with it through your project. SE already has enough of that "stuff changing out from under me" feel without adding to the issue.
Why do seagulls have wings?
To beat the abos to the tip.
Who cares about the dead interpreter known as .NET Why is the story of Slashdot being sold not on SLASHDOT!?!?!?
http://arstechnica.com/information-technology/2015/07/dhi-group-plans-to-sell-off-slashdot-and-sourceforge/
Wait until the .1 release of Windows 10 unless you have to be on the bleeding edge. Despite the promises made by Microsoft, it'll have bugs, cause problems and third party support will be lagging.
Harrison's Postulate - "For every action there is an equal and opposite criticism"
On the other hand if you fall behind current dev tools, you miss out on the potential for a lot of community support, risk being crippled by the bugs that remain in the older system that are fixed the new, and hamstring your ability to work as effectively as you might because you cannot use newer tooling/frameworks to help with development...
Yes SE has a lot of stuff changing, it always has and always will. But cringing from the pain will not help, SE is not finding any kind of safe plateau (because there are none). It is moving ever forward at a reasonable pace, using nettles as handholds where you must grasp them firmly as you ascend, living with the brief pain to move forward.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
typical .NET version? As we've seen from the fact that there just doesn't seem to be any reliable pieces of software available for Windows, it is simply unreliable and has always been. I know the seventy Windows desktops I manage only average about two days of uptime. Microsoft's garbage is just horrific.
> this means developers must make the difficult choice between using the latest tools or risking crippling bugs such as this one.
Not so difficult. Just don't use the latest and not-so-greatest stuff.
Que 1000 "waaaaah, I wanna to use teh new shiney!!11!!" replies....
Showstopper bug on a much awaited release! Ah, the fruits of jumping on the open source bandwagon...
As much as I love Microsoft .Net and the tools. We all know never to use the latest/greatest from Microsoft. I'm using VS.2013 until the first service pack or two are released.
"Ha-ha!"
-- Nelson
I do not fail; I succeed at finding out what does not work.
Can I use my HOSTS file to redirect the original parameters to the called method? I understand this will be very efficient due to HOSTS being evaluated in the kernel.
DO NOT BREAK USER SPACE.
This bug is in the JIT optimizer of the 4.6 framework. For apps you are developing, it's absolutely no problem, you just go into the compiler settings and uncheck the 'optimize' setting.
The problem though, is that the 4.6 framework is an in-place replacement for the 4.5 framework, which was an in-place replacement for the 4.0 framework. And the JIT optimizer is on by default. So if you install the 4.6 framework, it could potentially introduce this bug into any application developed targeting the 4.0, 4.5, or 4.6 framework that is already distributed.
Luckily, it appears as though the issue is a combination of a nullable int that has a bug in the boxing/unboxing of it's operator when calling the .hasValue method. So the actual number of places where this will actually pop up is hopefully quite limited.
That said, MS better get this patch deployed ASAP. Or if you are in a critical hurry, the correction has already been committed to the .Net Git repo, so you can brave a build from that.
-Rick
"Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
See subject & read the article: IF using .NET 4.6 don't turn on optimizations (yet) until they patch it.
APK
P.S.=> That's a "temporary work-around" for it - hosts have nothing to do with this (afaik @ least - & I suspect you're actually just trying to be a trolling pest here, one I've dusted badly on hosts before, & this is some insane butthurt form of effete "retaliation" on YOUR part - utterly useless)... apk
this means developers must make the difficult choice between using the latest tools or risking crippling bugs such as this one.
I don't know much about this but isn't it possible to just reduce the optimization level to avoid this behaviour? Sounds to me just skimming things that this the result of overly aggressive optimization. I know that's not a long term fix but is it a short term option until MS rolls out the patch?
Creationist Textbook Stickers Declared Unconstitutional by CowboyNeal
.
Some development tools are more stable than others from one version to the next, others are less stable. Managing the change then requires the developer to put into place the process for determining how to upgrade software tools in a manner consistent with the best outcome for the project.
Clearly, given the number and frequency of serious bugs coming out of Redmond of late, it is beginning to look as if Microsoft's QA team is either out to lunch, or has been laid off.
So any change mitigation strategy involving Microsoft products would probably have as it's #1 item: let new software from Microsoft settle down before using.
HTML based stringtype data, or better, filtered more so there's less on intake to finalization of intended data state integrity? Possibly - Yes, such as hostnames, yes, locally on a webserver (hardware) for serving a site & what not also.
You're letting ME be creative here so, possibly - latencies to disk MIGHT matter though, so,SSD @ the very least but better on hardware SSD (Gigabyte IRAM is what I use here, 4gb) for temp ops systemwide, pagefile, webbrowser cache, hosts file location, print spooler, %TEMP% ops, + %COMSPEC% location & yes, data I work with & of course, hosts itself.
Dedicated ramdisk in local system RAM? EVEN BETTER (faster too).
I'd do these parameters to it to insure tcpip.sys really concentrates on hosts to supplement it + loading it from @ LEAST SSD (for possible reloads) etc.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\ServiceProvider]
"Class"=dword:00000008
"HostsPriority"=dword:00000005
"DnsPriority"=dword:00000006
"LocalPriority"=dword:00000007
"NetbtPriority"=dword:00000008
"Name"="TCP/IP"
* It works for making it in RAM of somekind, constantly, doing more with less (or, the same, just doing it faster by not doing stuff it doesn't need to be, on things it does need to be doing = less CPU overheads in string processing too by filtered datasets).
I do most of that here except serving up a site: I'm the ghost in the machine & can't be seen, I'm NOT the body of it (internet machine from here @ least - I prefer "inviso-power" from DEFENDER - I'm no webmaster).. I'm it's soul.
APK
P.S.=> I am being nice in this post, thought about it, & there's how I'd apply it (I do as I post this in fact)... apk
Posting Anon testing to see if the troll mod to your post is undone. If it is, you're right. If it's not, I'll post a reply to this confirming such.
We're using .net on our production server, and since we implemented the new optimizer our system's been running super-fast! There's almost no load on the CPU anymore, leaving plenty for our Team Fortress server! That seems pretty optimum to me!
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
I just installed 8.1 with VS 2015 this weekend.
Is this serious enough where I need to re-image as things like my Intel RST raid driver all depend on 4.5 runtimes or does this only hit code being compiled?
http://saveie6.com/
I am not a developer, but if a few days after release are enough to find such a significant bug then it makes me wonder which quality processes Microsoft has in place and if anyone in Redmond even bothers using their own stuff for at least some test projects. So what's the plan for software companies these days? Fire everyone in quality assurance and hire more project managers who set arbitrary release dates and force rushed releases? Oh yay!