Where do "checked" and "free" come from?
People who have MSDN or the DDK know that Windows is typically built in two different flavors, "Checked" and "Free". The primary difference between the two is that the "checked" build has traces and asserts, but the free build doesn't.
Where did those names "checked" and "free" come from? It's certainly not traditional, the traditional words are "Debug" and "Retail" (or "Release").
When we were doing the initial development of Windows NT, we started by using the same "Debug" and "Retail" names that most people use.
The thing is, it turns out that there are actually four different sets of options that make up the "Debug" and "Retail" split.
You have:
- Compiler Optimization: On/Off
- Debug Traces: On/Off
- Assertions: Enabled/Disabled
- Sanity checks: Enabled/Disabled
Traditionally, "Debug" is "Optimization:off, Traces:on, Assertions: on" and "Retail" is "Optimization:on, Traces:off, Assertions: off". Sanity checks was something the NT team added. The idea was that there would be additional sanity checks built in for our internal development that would be removed before we shipped.
So the NT build team wanted to build "Optimization:on, Traces:on, Assertions: on, sanity checks:on" and "Optimizations:on, traces:off, assertions: off, sanity checks: on" and "optimizations:on, traces:off, assertions:off, sanity checks: off".
The last was what was traditionally called "Retail" - no debugging whatsoever. However, the question still remained - what to call the "O:on, T:on, A:on, S:on" and "O:on, T:off, A:off, S:on" build - the first wasn't "Debug" because the optimizer was enabled, the latter wasn't "Retail", since the sanity checks were enabled.
So clearly there needed to be some other name to differentiate these cases. After some internal debate, we settled on "Checked" for the "O:on, T:on, A:on, S:on" and "Free" for the "O:on, T:off, A:off, S:on" build. Checked because it had all the checks enabled, and free because it was "check free".
And as the NT 3.1 project progressed, the team eventually realized that (a) since they'd never actually tested the "retail" build, they had no idea what might break when they started making builds, and (b) since they had perf tested the free build and it met the perf criteria, the team eventually decided to ship the free build as the final version.
Comments
Anonymous
August 31, 2005
So, are there still sanity checks in the Free build?Anonymous
August 31, 2005
"After some internal debate, we settled on "Checked" for the "O:on, T:on, A:on, S:on" and "Free" for the "O:on, T:off, A:off, S:on" build. Checked because it had all the checks enabled, and free because it was "check free"."
Wait a sec... but they both have "S:on" (sanity checks on)... shouldn't they both be checked, and the differentiation be on the assertions?Anonymous
August 31, 2005
No, the point is that the sanity checks are always on, the original intent was that they'd be removed for retail, but that never happened.
The checked/free differentiation is about traces and asserts.Anonymous
August 31, 2005
David, yes, the sanity checks are still there. The concept of a "retail" build in it s original form no longer exists.Anonymous
August 31, 2005
Out of abject curiosity, is this only true in NT and derivatives, or does this include programs like office, exchange, etc as well? I know anything built in .Net would have various sanity checks as well.Anonymous
August 31, 2005
Can we get an example of a sanity check you're likely to find within Windows?Anonymous
August 31, 2005
> And as the NT 3.1 project progressed, the
> team eventually realized that (a) since
> they'd never actually tested the "retail"
> build,
With more modern versions the opposite seems to be the case. For example maybe I'm the only person who tried to install Visual Studio 2005 July CTP onto a checked build (couldn't do it) or the earlier beta 2 (got most of it done). And maybe I'm the only person who noticed some of the messages displayed in WindBag by mmc.exe and some other stuff under a checked build. Obviously the kernel itself does run under a checked build so some teams are still dogfooding a checked build, and some driver writers mention how much they depend on checked builds. Can you persuade some of the other teams how valuable it would be to do the same?Anonymous
August 31, 2005
I think this is the first post from you about internal stuff that I had absolutely no clue about. I had no idea whatsoever. And I'd never thought to ask anyone.
Thanks for the info.
I wonder why there is no "Windows Lore" wiki somewhere. I haven't even seen anything like that internally. Without one, what will the rest of us do when the mothership comes to take you and Raymond away?Anonymous
August 31, 2005
How does one decide what becomes an assertion and what becomes a sanity check? Aren’t both assumptions that will cause undefined behavior if violated?Anonymous
August 31, 2005
The comment has been removedAnonymous
August 31, 2005
The comment has been removedAnonymous
September 01, 2005
Oh sorry, I misunderstood. I thought Windows had generic sanity checking in it today...
Although it kind of does if you compile using Visual Studio 2005 but not things that the programmer has to worry about.Anonymous
September 01, 2005
Manip, there are all KINDS of sanity checks in the OS. But they're all just part of the normal OS, they're not specifically called out.
At one time there were #if !RTL conditional compilation macros around the "sanity checks", the #if checks have been removed because we're never going to turn the RTL flag on.Anonymous
September 01, 2005
The comment has been removedAnonymous
September 01, 2005
I worked on Microsoft's Windows 2000 QA team back in the mid 1990s. We rarely tested the checked builds, but I would occasionally. The checked builds were sloooooow, like 20x slower than the free builds!Anonymous
September 01, 2005
The comment has been removedAnonymous
September 01, 2005
I understand. I just place sanity checks in their own category, I mean when you for example read in data and want to check IF(Number(Data)) that isn't a "sanity check", that is a validation check. A sanity check is when you have had the data within the program for a while and just add a random check to make sure whatever you're processing is what you think it is.. But something that you NEVER intend to trip off.Anonymous
September 01, 2005
>> we settled on "Checked" for the "O:on, T:on, A:on, S:on"
Is it still true today? Currently DDK setenv.bat file sets O:off for "Checked" build.
:checked
rem set up an NT checked build environment
set MSC_OPTIMIZATION=/Od /Oi
/Od - This option turns off all optimizationsAnonymous
September 02, 2005
Here's an sampling of various goofy bugs we've had to deal with in the CLR Debugging services over the...Anonymous
September 02, 2005
> we settled on "Checked" for the "O:on, T:on, A:on, S:on"
Is it still true today? the DDK build environment sets /Od for checked build and disables compiler optimization.
set MSC_OPTIMIZATION=/Od /OiAnonymous
September 03, 2005
Wei, that's the DDK, not what's MS builds.
The optimizations are turned off because optimizations will mess up debugging. We live with the inconvenience internally because it catches optimizer bugs, but that's a concious choice that we made internally.Anonymous
September 04, 2005
Thursday, September 01, 2005 2:22 PM by Chris
> The checked builds were sloooooow, like 20x
> slower than the free builds!
Yes, but they catch 20x as many bugs.
Does someone really read reports sent by Windows Error Reporting? If so, ask them if it would have been 20x slower for developers and testers to dogfood Microsoft's own code on a checked build than it is for analysts to interpret the reports.Anonymous
September 11, 2005
Wednesday, August 31, 2005 9:48 PM by Norman Diamond
> Obviously the kernel itself does run under a
> checked build
Liar. Did you even think of trying Windows XP SP2 checked build in any environment other than guest machine under Virtual PC? Uhhh, OK sure you did, there's that 7 year old desktop machine on that desk next to you and it worked, but did you even think of trying a 5 year old machine with devices more powerful than the Virtual PC emulations? And how are you going to find if newer drivers even exist when Internet Explorer aborts every time you try to do a Windows Update?
You should think about things like that before you post. "Obviously" indeed. You know how much you hate it when you find yourself lying.Anonymous
January 13, 2007
That must have hurt...Anonymous
June 16, 2009
PingBack from http://topalternativedating.info/story.php?id=14164Anonymous
June 18, 2009
PingBack from http://thestoragebench.info/story.php?id=1510