.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.
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
Lots of people care, including myself. I develop using .NET and this is very useful information for me. This is the exact kind of information I would expect out of Slashdot: tech information that helps me in my tech-oriented job.
.NET is in no way "dead", despite your obvious hatred for it.
Which is the problem with Microsoft trying to force people to use it, and deciding they're going to be forcing updates.
They're saying they're doing it for security, but time and time again Microsoft has demonstrated they're not trustworthy in their updates.
My experience says taking a day 1 anything from Microsoft is a recipe for disaster. In fact, taking a day 1 from anybody is.
Microsoft is basically breaking first and fixing later. The problem is it isn't Microsoft's stuff which ends up broken, and bad release engineering is costly to companies.
Sorry, but Microsoft hasn't demonstrated we should ever trust them with continuous releases. They've demonstrated the opposite, in fact.
Lost at C:>. Found at C.
Well, ignoring the rest of your comment, this is actually worth highlighting.
Good riddance, dice.
Sorry we couldn't help you leverage your synergies.
Actually, we're not sorry at all.
Lost at C:>. Found at C.
I guess the expected tsunami of techies eager for SJW articles never arrived.
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
I check the Disable Advertising box. Therefore, in order to contribute ad impressions, I must start flame wars.
Oh, don't misunderstand me ... I know people do need this stuff when it's fresh and steaming, and have no choice.
I'm saying that, in general, as a change management strategy, taking the first day release of a fix has been demonstrated to be a terrible idea. Over and over and over by pretty much every software vendor.
Many of us support production machines and mission critical things, which means there's no way in hell we'd apply these on the day they get released.
What really annoys me is Microsoft's increasing push to force people to take those updates on day one, and be stuck with the consequences of that.
So, imagine a world in which some poor schmuck is running the version of Windows 10 which doesn't let you defer updates. When Microsoft pushes this crap out, suddenly a huge amount of people have broken systems. Microsoft isn't going to pay to fix that. Microsoft isn't going to have to deal with the consequences of the outage.
So, the general advice of "if you don't absolutely need this on the day of release, wait" is the best strategy if you can't be on the bleeding edge every day Microsoft has a new fix.
Microsoft seems bent on taking that away. And that, in my opinion, is idiotic and dangerous.
If you need to be on the cutting edge, you should probably be taking your own steps to recover from that. Mine is let everyone else test first. ;-)
Lost at C:>. Found at C.