This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[bug svn 514221] torrent creation 4.4GB file ends up 109.6MB

Tags: None
(comma "," separated)
stoeptegel
Registered Member
Posts
1075
Karma
0
Creating a torrent with two files in folder island_fever3_HD

../island_fever3_HD/IslandFever3.nfo 2.4KB -> 2.4 KB
../island_fever3_HD/IslandFever3.wmv 4.4GB-> 109.6MB

Filesystem: ext3
Chucksize: 1024
Start seeding: no
Private: yes
For testing i tried the rufus client for making this torrent, and it made a proper torrent of the directory. So i guess it's a KTorrent or a KDE library bug. (nice and small huh... :wink: )

PS.I have uploaded the torrent on a tracker at the moment, so if you wanna have it for testing just pm me and i'll point you to the right direction. (note: 4.4GB though)
George
Moderator
Posts
5421
Karma
1

Thu Mar 02, 2006 5:33 pm
I would need the data to be able to reproduce this, but you can send me the torrent, so I can have a look at that.
stoeptegel
Registered Member
Posts
1075
Karma
0

Fri Mar 03, 2006 11:23 am
You've got PM.
George
Moderator
Posts
5421
Karma
1

Fri Mar 03, 2006 5:39 pm
Can you also send me the generated KT torrent for comparison ?
stoeptegel
Registered Member
Posts
1075
Karma
0

Fri Mar 03, 2006 6:03 pm
You've got PM.
George
Moderator
Posts
5421
Karma
1

Fri Mar 03, 2006 6:46 pm
It seems I was relying on a Qt class which gave back the size of a file in a 32 bit number (doesn't work well with files > 4 GB)
stoeptegel
Registered Member
Posts
1075
Karma
0

Sat Mar 04, 2006 2:54 pm
That was a fast recover again :)
Looking forward to test a fix when it's done.
George
Moderator
Posts
5421
Karma
1

Sun Mar 05, 2006 1:25 pm
Should be fixed now,
imported4-ddv
Registered Member
Posts
22
Karma
0

Mon Mar 06, 2006 10:39 am
cool!
Thanks for the great work you are doing George, and all the bug fixing that have been done this weekend 8)
stoeptegel
Registered Member
Posts
1075
Karma
0

Tue Mar 07, 2006 2:17 pm
Oeps, i forgot to thank you... :oops:
Bug is solved for me too.

Thanks for your hard work!
8 euro paypal coming your way...
George
Moderator
Posts
5421
Karma
1

Tue Mar 07, 2006 6:28 pm
You are far to generous stoeptegel, thanks.
oh2mqk
Registered Member
Posts
3
Karma
0

ktorrent still

Wed Dec 06, 2006 1:10 am
George wrote:It seems I was relying on a Qt class which gave back the size of a file in a 32 bit number (doesn't work well with files > 4 GB)


This problem is still present in Fedora Core's ktorrent-2.0.3-4.fc6.x86_64.rpm package
about half a year latter. Wasn't the fix propagated to maintained baseline ?

Also, it appears in lattest beta binaries (for SuSE) and is trivially easy to test for.
Create a file with size of 4.0 GB + some, and observe the "new torrent" to be created
with size "some".

$ touch test.file
$ perl -e 'truncate("test.file", 4*1024*1024*1024+100);'


/Matti Aarnio

PS: Lattest code refuses to compile on Fedora Core 6 platform with most confusing error message. I definitely have kdelibs installed, but the thing is looking for something else ?
JiiPee
Registered Member
Posts
5
Karma
0

Wed Dec 06, 2006 4:05 am
I think it's only fixed on latest svn..

http://sotapeli.fi/ktorrent-2.1svn610701-1.fc6.src.rpm

Try to build that.
George
Moderator
Posts
5421
Karma
1

Wed Dec 06, 2006 7:19 pm
Wtf, if this was fixed in march it should have been part of 2.0 and any later release.
ranger2k
Registered Member
Posts
8
Karma
0

Mon Jan 15, 2007 6:07 pm
George wrote:Wtf, if this was fixed in march it should have been part of 2.0 and any later release.


I traced the issue and found the cause:

libktorrent/torrent/torrentcreator.cpp
@@ -193,8 +199,8 @@
}
else
{
- enc.write("length"); enc.write((Uint64)fi.size());
-
+ enc.write("length"); enc.write((Uint64)bt::FileSize(fi.absFilePath()));
+
}
enc.write("name"); enc.write(name);
enc.write("piece length"); enc.write((Uint64)chunk_size);

Also I don't undertsand this piece of code a bit early:
...
else
{
tot_size = bt::FileSize(target);
num_chunks = tot_size / chunk_size;
if (tot_size % chunk_size > 0)
num_chunks++;
last_size = tot_size % chunk_size;
Out() << "Tot Size : " << tot_size << endl;

tot_size = fi.size();

At first you got correct file size with bt::FileSize(target) and after that in the end just replaced it with wrong one. QFileInfo::size is uint 32 so just impossible to get size > 4Gb. Looks like a bad merge for me.

--
Alexey


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]