Bug 97073 - file copy progress dialog shows incorrect values when copying files > 2GB
Summary: file copy progress dialog shows incorrect values when copying files > 2GB
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: uiserver (show other bugs)
Version: 3.3.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 85653 107189 112850 128241 140199 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-15 15:25 UTC by James
Modified: 2010-08-16 12:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James 2005-01-15 15:25:19 UTC
Version:           3.3.2 (using KDE 3.3.2, Gentoo)
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.10-gentoo-r4

If I copy a large (i.e 3GB or more) file from one computer to another using the Samba part of Konqueror, the progress meter shows very wrong values after around 2GB of file copied.

According to the progress meter, the file is 100% copied and was 16,777,216.0 TB in size.

Which is slightly wrong I think ;-)

The file copying appeared to continue and completed OK though.
Comment 1 Thiago Macieira 2005-01-17 02:46:12 UTC
Does it happen only when Samba is one of the endpoints? Or does it happen when copying such files across different paths in the local system as well?
Comment 2 Martin Koller 2006-05-15 09:40:09 UTC
I can confirm the bug (when copying from smb to local file).
Did not check local/local.
Comment 3 Martin Koller 2006-05-15 09:46:34 UTC
Forgot to add: this is KDE 3.5.2
Comment 4 Björn Nilsson 2006-07-07 16:23:41 UTC
I can confirm this aswell, when 2.0 GB is copied dialog shows strange values. After a while it starts over from zero % aswell (see screenshot). I am copying from smb to local drive.

http://bni.dyndns.org/large_file_copy_dialog.png

the result of the copy seems fine, only progress that is bugged.
Comment 5 Jens Rutschmann 2006-07-30 18:19:41 UTC
I tried a local / local copy and that one worked.

So I had a look at the sources of the smb kioslave and I think I might have found the problem.

In file kdebase-3.5.2/kioslave/smb/kio_smb_dir.cpp line 51:
int processed_size = 0;

I think that should be:
ssize_t processed_size = 0;

However I couldn't test it, make tells me (after executing kdebase-3.5.2/configure):
make: *** No targets specified and no makefile found.  Stop.

I guess I missed some preparation steps but perhaps it helps you anyway. At least it *could* be the reason for that TB filesize value.
Comment 6 Martin Koller 2006-11-26 21:12:14 UTC
SVN commit 608111 by mkoller:

BUG:    97073

Fix correct display of file size transfers > 2GB


 M  +1 -1      kio_smb_browse.cpp  
 M  +1 -1      kio_smb_dir.cpp  
 M  +2 -2      kio_smb_file.cpp  


--- branches/KDE/3.5/kdebase/kioslave/smb/kio_smb_browse.cpp #608110:608111
@@ -47,7 +47,7 @@
 {
     int result = smbc_stat( url.toSmbcUrl(), st);
     kdDebug(KIO_SMB) << "smbc_stat " << url << " " << errno << " " << result << endl;
-    kdDebug(KIO_SMB) << "size " << (long)st->st_size << endl;
+    kdDebug(KIO_SMB) << "size " << (KIO::filesize_t)st->st_size << endl;
     return result;
 }
 
--- branches/KDE/3.5/kdebase/kioslave/smb/kio_smb_dir.cpp #608110:608111
@@ -48,7 +48,7 @@
     int             dstflags;
     int             srcfd = -1;
     int             dstfd = -1;
-    int             processed_size = 0;
+    KIO::filesize_t processed_size = 0;
     unsigned char   buf[MAX_XFER_BUF_SIZE];
 
     kdDebug(KIO_SMB) << "SMBSlave::copy with src = " << ksrc << "and dest = " << kdst << endl;
--- branches/KDE/3.5/kdebase/kioslave/smb/kio_smb_file.cpp #608110:608111
@@ -44,7 +44,7 @@
     // time_t      curtime         = 0;
     time_t      lasttime        = 0;
     time_t      starttime       = 0;
-    ssize_t     totalbytesread  = 0;
+    KIO::filesize_t totalbytesread  = 0;
     QByteArray  filedata;
     SMBUrl      url;
 
@@ -122,7 +122,7 @@
 
         smbc_close(filefd);
         data( QByteArray() );
-        processedSize( st.st_size);
+        processedSize(static_cast<KIO::filesize_t>(st.st_size));
 
     }
     else
Comment 7 Martin Koller 2006-11-26 22:03:48 UTC
*** Bug 85653 has been marked as a duplicate of this bug. ***
Comment 8 Martin Koller 2006-11-26 22:29:53 UTC
*** Bug 107189 has been marked as a duplicate of this bug. ***
Comment 9 Tommi Tervo 2007-02-20 14:29:46 UTC
*** Bug 128241 has been marked as a duplicate of this bug. ***
Comment 10 FiNeX 2010-08-16 12:27:03 UTC
*** Bug 112850 has been marked as a duplicate of this bug. ***
Comment 11 FiNeX 2010-08-16 12:27:10 UTC
*** Bug 140199 has been marked as a duplicate of this bug. ***