Jun 18, 2007

Microsoft .NET Release Bug


This article demonstrates a major flaw in the Microsoft .NET Framework 1.1. To my knowledge, there isn't a patch to fix the problem.


You may ask ... "What is a Release Bug?"

A release bug is the outcome of code that was written to be output differently when compiled in different modes. Take for example that you have a simple program that adds two variables, and outputs the data. Say the input values were (2, 2) and the result returned SHOULD BE EQUAL to 4. If compiled in debug mode you get the answer 4 and in release mode you get the answer 5. Sounds funny? It's NOT FUNNY AT ALL! This is a real problem. Now the example I just used does not produce a RELEASE BUG, but was just for you to understand the scope of the problem.

Now there are 4 different ways that a program can be run:

  1. Through the Visual Studio IDE in DEBUG mode
  2. Through the Visual Studio IDE in RELEASE mode
  3. Run the EXECUTABLE that was compiled in DEBUG mode
  4. Run the EXECUTABLE that was compiled in RELEASE mode (this is where the RELEASE BUG appears)

Three of the four running applications will return the same results, while that last will return irregular results. Release bugs are some of the hardest bugs to find. Nowhere is there a compile error, logical error, warning, or anything at all. Sorry there is one thing ... NOTHING. When sifting through 60,000+ lines of code to look for this, it becomes quite complex. Don't give up, they are possible to find.

The code compiled here demonstrates the problem I encountered and what I did to fix it. I also explain ways to help fix the problems.

Read More : Click