Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
64-bit error

64-bit error

31 Mar 2013

In our articles and documentation on PVS-Studio, this term means an error in C/C++ code that occurs when compiling the program in 64-bit mode. The code containing a 64-bit error correctly executes in 32-bit mode and causes a hang / access violation / slowdown / undefined behavior when launching the program built in the 64-bit configuration.

Here is an example:

float *Array = (float *)malloc(100 * sizeof(float));
float *ptr = Array + 50;
unsigned index = -1;
ptr[index] = 3.14f;

This code will lead to the error "Access Violation" on a 64-bit system. The value of index variable is 0xFFFFFFFFu and access to an item with this index is impossible. However, this code might have successfully worked for ten years in the 32-bit program where the operation ptr+0xFFFFFFFFu is equivalent to the operation ptr-1. Such errors are described more thoroughly in the article "A Collection of Examples of 64-bit Errors in Real Programs".

Those errors that we call "64-bit" may also show up on the systems whose architecture differs from Intel 64 / IA64. The code containing "64-bit errors" is often inefficient and incorrect and performs the actions it has been designed to perform only due to mere luck and peculiarities of the 32-bit architecture. The term "64-bit error" is introduced to single out the class of errors the programmer starts to encounter with while developing code for a 64-bit system or porting the existing 32-bit code to a 64-bit platform. It is possible to describe and diagnose the class of 64-bit errors at the stage of coding and therefore significantly reduce costs on testing and support of the 64-bit version of a software product. The diagnosis of this error class is implemented to the most extent in the static analyzer Viva64 included into PVS-Studio.

References

Popular related articles

S'abonner

Comments (0)

close comment form
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam