Uninitialised data is a common problem, often caused by failing to initialise data in the constructor of an object.
The results of uninitialised data often go un-noticed in release builds as the default values provided by the C runtime (0xCD in each byte for dynamic memory, 0xCC in each byte for stack memory) mean that boolean values have a 50% chance of being the expected value, and even in the case where it is not the expected value, the behaviour is repeatable. However, for release software, these values are random, resulting in a 1 in 4 billion chance that FALSE will be present, rather than TRUE. For values that are not boolean, in debug code the values are repeatable, in release code the values are random.
For the above noted reasons, a common symptom of uninitialised data is a “release only” bug. Memory Validator provides features that allow you to detect data in C++ objects that has not been initialised. This functionality works in debug mode.
On the Memory settings display dialog, select the two Uninitialised Data display check boxes in the Types of error message to display section. This will ensure that the memory tab will display uninitialised data warnings if uninitialised data is found.
To enable the detection of uninitialised data, you can enable the simple on/off switch on the Collect tab
or you can select the more comprehensive options on the Uninitialised data tab. The recommended defaults are shown in the image.