Pour obtenir une clé
d'essai remplissez le formulaire ci-dessous
Demandez des tariffs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
* En cliquant sur ce bouton, vous acceptez notre politique de confidentialité

Free PVS-Studio license for Microsoft MVP specialists
To get the licence for your open-source project, please fill out this form
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

I am interested to try it on the platforms:
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

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

12 Mar 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:

  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.


Comments (0)

Next comments
Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus