Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Use of uninitialized memory

Use of uninitialized memory

Mar 12 2013

Use of uninitialized memory means reading data from the buffer that was allocated but not filled with initial values. The program behavior in this case is considered an error which is quite difficult to detect sometimes. This is a so called "heisenbug". Whether or not the error reveals itself depends on the compiler version or operating system version as well as which program version, "debug" one or "release" one, you're running.

The error may occur because of an incorrect initialization order or race condition in a multi-threaded application. In any case, it means that the data are starting to be used before they are initialized.

Consider an example of this error:

dgCollisionCompoundBreakable::dgCollisionCompoundBreakable(....)
{
  ....
  dgInt32 faceOffsetHitogram[256];
  dgSubMesh* mainSegmenst[256];
  ....
  memset(faceOffsetHitogram, 0, sizeof(faceOffsetHitogram));
  memset(mainSegmenst, 0, sizeof(faceOffsetHitogram));
  ....
}

The error is this: the 'mainSegmenst' array is initialized incompletely. This code will work correctly in the 32-bit program where the pointer size coincides with that of the 'int' type; but it will fail in the 64-bit program.

References

Popular related articles


Comments (0)

Next comments next comments
close comment form