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.

>
>
>
Issues of 64-bit code in real applicati…

Issues of 64-bit code in real applications: and what about Linux?

Oct 11 2010

While telling programmers about 64-bit issues they may encounter when porting their programs, I often hear reproaches: "Yes, surely - such is your Windows... How good it is that Linux has had no problems with 64-bit code for a long time!".

"It is not so, my inquisitive readers". Today's post is about a 64-bit error in the Linux kernel. A wonderful site with bug tracking system by the kernel's developers contains the description of bug 16603 (send of data > 4 GB fails on 64 bit systems). The issue is simple: "Send of data using the Linux-function send() leads to an error if the data's size is too large". This is how the function looks in glibc:

ssize_t send(int sockfd, const void *buf, size_t len, int flags);

Everything is correct and the size is passed as a memsize-type size_t. But this argument is saved in the msgheader structure and after that there are the following lines inside the tcp_sendmsg function:

while (--iovlen >= 0) {
                int seglen = iov->iov_len;
                unsigned char __user *from = iov->iov_base;

Here, the length is saved in int and it is certainly a bad thing. That is, if you send a block of 5 Gbytes using send(), only 1 Gbyte will be sent while sending a 4-Gbyte block will have no result (due to truncation to zero).

Of course, the workaround is clear - we should specify length not larger than 0x8000000, but it is an error and of course we should fix it.

Yes, by the way, it is not a sample from the nineties - the bug was discovered in August, 2010, and refers to the kernel of version 2.5. And it is still (October 11, 2010) not fixed. And you tell me that Linux does not have 64-bit issues...

Popular related articles


Comments (0)

Next comments next comments
close comment form