On Thu, 2009-12-17 at 19:55 +0100, David Eriksson wrote:
> Any takers? 64-bit issue in my crappy code? :-)
> 
> \David
> 
> email message attachment
> > -------- Forwarded Message --------
> > From: Sascha Silbe <sascha-debian-bugs-librapi2-tool...@silbe.org>
> > Reply-to: Sascha Silbe
> > <sascha-debian-bugs-librapi2-tool...@silbe.org>,
> > "561...@bugs.debian.org" <561...@bugs.debian.org>
> > To: Debian Bug Tracking System <sub...@bugs.debian.org>
> > Subject: Bug#561501: librapi2-tools: synce-pcp transfer speed
> > calculation totally off
> > Date: Thu, 17 Dec 2009 19:06:44 +0100
> > 
> > Package: librapi2-tools
> > Version: 0.11.1-2
> > Severity: minor
> > 
> > 
> > The transfer speed synce-pcp displays after finishing the transfer is 
> > totally off:
> > 
> > File copy of 5448098 bytes took 0 minutes and 16 seconds, that's 
> > 738849265627674 bytes/s.

I've seen this one before, but only on Debian, and frankly I don't
understand it. Lets try and run through it.

If we assume the bytes copied and time shown are correct
representations, which seems reasonable, then 

size_t bytes_copies = 5448098
time_t duration = 16

so the offending calculation is

(size_t) 5448098 / (time_t) 16

which is then passed to printf as a long int (%li). Is this an awkward
printf / arithmetic promotion thing ? Maybe the printf should use %zi ?
This is really awkward to figure out unless it happens to us :)


> > File copy of 6666971 bytes took 0 minutes and 19 seconds, that's 
> > 755515038539275 bytes/s.
> > File copy of 4687934 bytes took 0 minutes and 13 seconds, that's 
> > 779445379125095 bytes/s.
> > File copy of 3720359 bytes took 0 minutes and 10 seconds, that's 
> > 802179202683818 bytes/s.
> > File copy of 4101747 bytes took 0 minutes and 12 seconds, that's 
> > 738849265628980 bytes/s.
> > File copy of 2663444 bytes took 0 minutes and 7 seconds, that's 
> > 824294418796108 bytes/s.
> > File copy of 850547 bytes took 0 minutes and 3 seconds, that's 
> > 609843838298321 bytes/s.
> > File copy of 3833208 bytes took 0 minutes and 11 seconds, that's 
> > 754841673975190 bytes/s.
> > File copy of 5167020 bytes took 0 minutes and 15 seconds, that's 
> > 741194818854769 bytes/s.
> > File copy of 2736587 bytes took 0 minutes and 8 seconds, that's 
> > 738849265629241 bytes/s.
> > File copy of 4554187 bytes took 0 minutes and 13 seconds, that's 
> > 757794118593571 bytes/s.
> > File copy of 3771036 bytes took 0 minutes and 11 seconds, that's 
> > 742047747297899 bytes/s.
> > File copy of 3424130 bytes took 0 minutes and 9 seconds, that's 
> > 828762139221091 bytes/s.
> > File copy of 3784098 bytes took 0 minutes and 11 seconds, that's 
> > 742047747299086 bytes/s.
> > File copy of 2425208 bytes took 0 minutes and 7 seconds, that's 
> > 763980193024346 bytes/s.
> > File copy of 4444996 bytes took 0 minutes and 13 seconds, that's 
> > 736142858063936 bytes/s.
> > File copy of 5857698 bytes took 0 minutes and 16 seconds, that's 
> > 791624213173786 bytes/s.
> > File copy of 1290971 bytes took 0 minutes and 4 seconds, that's 
> > 703665967262902 bytes/s.
> > File copy of 7148147 bytes took 0 minutes and 20 seconds, that's 
> > 774032563991583 bytes/s.
> > File copy of 1729828 bytes took 0 minutes and 5 seconds, that's 
> > 759959244641338 bytes/s.
> > File copy of 6052571 bytes took 0 minutes and 16 seconds, that's 
> > 818011686946221 bytes/s.
> > File copy of 3287249 bytes took 0 minutes and 9 seconds, that's 
> > 797488096230764 bytes/s.
> > File copy of 1968587 bytes took 0 minutes and 5 seconds, that's 
> > 872545799399515 bytes/s.
> > 
> > 
> > -- System Information:
> > Debian Release: 5.0.3
> >     APT prefers stable
> >     APT policy: (500, 'stable')
> > Architecture: amd64 (x86_64)
> > 
> > Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
> > Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> > Shell: /bin/sh linked to /bin/dash
> > 
> > Versions of packages librapi2-tools depends on:
> > ii  libc6                      2.7-18        GNU C Library: Shared 
> > libraries
> > ii  librapi2                   0.11.1-2etch1 Make RAPI calls to a 
> > Windows Mobil
> > ii  libsynce0                  0.11.1-1etch1 Helper library for SynCE, a 
> > tool t
> > 
> > librapi2-tools recommends no packages.
> > 
> > librapi2-tools suggests no packages.
> > 
> > -- no debconf information
> > 
> > CU Sascha
> > 
> > -- 
> > http://sascha.silbe.org/
> > http://www.infra-silbe.de/

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to