aMule Bug Tracker - aMule
View Issue Details
0000579aMuleMulti Platformpublic2005-09-18 12:332005-11-11 15:45
0000579: Windows: amule kills itself when opening files > 2Gb
If a file bigger than 2Gb is being shared, when the method GetLengh() is called on the related CFile instance, the application abnormally exit.
The macro MULE_VALIDATE_STATE in CFile.cpp:557 causes amule to exit.
The cause is that under win32 the off_t type is signed.

MULE_VALIDATE_STATE(iRc >= 0, wxT("CFile: Invalid file length"));
No tags attached.
Issue History
2005-09-18 12:33GnuccoNew Issue
2005-09-22 17:19KryStatusnew => assigned
2005-09-22 17:19KryAssigned To => Xaignar
2005-09-22 17:19KryNote Added: 0001286
2005-09-23 20:06XaignarNote Added: 0001288
2005-11-11 15:45XaignarStatusassigned => resolved
2005-11-11 15:45XaignarFixed in Version => CVS
2005-11-11 15:45XaignarResolutionopen => fixed
2005-11-11 15:45XaignarNote Added: 0001437

2005-09-22 17:19   
This is for xaignar
2005-09-23 20:06   
off_t is signed under linux (posix?) as well (otherwise the check wouldn't make sense), however, the fact that the value is negative suggets that the size of the type is only 4 bytes, whereas it is 8 bytes on linux when large-file support is enabled. The question is then, how do we check for invalid values. It seems to me that changing CFile to use the 64bit seek/tell functions is required, though it would require moving away from using the off_t type.
2005-11-11 15:45   
Fixed on current CVS. ;)