This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Log corruption with log > 4 GB

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs Printable version
View previous topic :: View next topic  
Author Message
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10916
Location: Bratislava, Slovakia

PostPosted: Wed May 09, 2018 6:08 pm    Post subject: Log corruption with log > 4 GB Reply with quote

Hi,
TC 9.20b2 x64, Windows 10 x64, but I assume this is not a new behavior in 9.20.
It seems the log gets corrupted when it reaches a certain size, here it is 4 295 006 800 bytes. The entries do not get appended at the end but the first entries get overwritten - looks like an unsigned long integer is used as the position pointer or something like that.

TIA
Roman
_________________
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35943
Location: Switzerland

PostPosted: Thu May 10, 2018 9:36 am    Post subject: Reply with quote

Thanks, I can reproduce it. Apparently it's a limitation of SetFilePointer: I call it like this:
SetFilePointer(hFile,0,NULL,FILE_END);
It tells Windows to position the read/write position to the end of the file. However, this fails when the file is > 4GB, although the parameter lpDistanceToMoveHigh is described as optional.

It works when I call it like this:

highPosition=0;
SetFilePointer(hFile,0,&highPosition,FILE_END);

Apparently it's because of this limitation:
Quote:
If lpDistanceToMoveHigh is NULL and the new file position does not fit in a 32-bit value, the function fails and returns INVALID_SET_FILE_POINTER.

_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35943
Location: Switzerland

PostPosted: Wed May 16, 2018 10:43 am    Post subject: Reply with quote

This should be fixed in beta 3, please test it!

Note: Both the normal log and ftp log are affected.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10916
Location: Bratislava, Slovakia

PostPosted: Wed May 16, 2018 2:09 pm    Post subject: Reply with quote

Christian,
Seems to work fine, thank you!

Roman
_________________
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group