bugBongo Project - Bugs: bug #10248, 64bit problem: we assume the size...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #10248: 64bit problem: we assume the size of off_t type

Submitted by:  Alex Hudson <alexhudson>
Submitted on:  Fri 02 Nov 2007 04:38:31 PM UTC  
 
Category: Mail queue (Queue agent)Severity: 4 - Important
Priority: 1 - LaterStatus: Confirmed
Privacy: PublicAssigned to: Patrick Felt <pfelt>
Open/Closed: Open

Fri 02 Nov 2007 04:38:31 PM UTC, original submission:

(assigning to Pat just so he's copied in on the bug :)

At the moment, the off_t type is used in a couple of places in Bongo, e.g. the queue. The data is sometimes printed out in client/server conversations, viz.:

ConnWriteF(client->conn, "6020 %03d-%s %ld %ld %ld\r\n", queue, entry, (unsigned long)sb.st_size, dSize, lines);
ConnWriteFile(client->conn, fh);

(queue.c:1631 as of svn r525). Sometimes we do it %ld with a cast, other times %lu. Both are wrong.

The sb.st_size is part of 'struct stat', and is of type off_t. This type is different on different systems: 32 or 64 bits.

Probably what we need to do is say that the protocol outputs a value which is an unsigned integer to be contained in 64bits. On 32-bit platforms, we have a slight issue when we have to consume that value, though - we probably have 64-bit types, but we might have issues with files who are so big you need the 64-bits to measure their size :)

There is a general issue here about arch-neutrality of the protocol: that really means we need to define the types needed to hold different types of data. This is probably a post-Bongo 1.0 job, though.

The easy solution for now is probably to downgrade the sb.st_size value to a 32-bit one, and refuse to deal with situations where that causes a problem (e.g., QRETR). The number of files greater than 2Gb etc. should be relatively small in the field.

Alex Hudson <alexhudson>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by alexhudson (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup