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.

>
>
>
64-bit error

64-bit error

Mar 31 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


Comments (0)

Next comments next comments
close comment form