samba-bugs at samba.org
2015-Jul-04 04:38 UTC
[Bug 11382] New: elapsed time calculation does not account for time function possibly returning -1
https://bugzilla.samba.org/show_bug.cgi?id=11382 Bug ID: 11382 Summary: elapsed time calculation does not account for time function possibly returning -1 Product: rsync Version: 3.1.1 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 Component: core Assignee: wayned at samba.org Reporter: brant at gurganus.name QA Contact: rsync-qa at samba.org starttime currently initialized on line 1529 of main.c and endtime currently initialized on line 222 of main.c, both of which are used on line 344 are used in a manner that does not handle that time(NULL) can return -1. Out of curiosity, I did try reading through the glibc source code for that function to find it currently does return -1, and at the glibc level, that's all that the time function does unless appropriate bridging to a kernel is implemented. I did not take the time to try looking at other libc implementations or to see under what conditions the linux kernel might return -1. As I only see one usage on line 344, if one of those two values comes back as -1 for some reason, perhaps that information line should be ommitted or replaced since the statistic trying to be printed would not be a valid statistic if one of the two time() calls returned -1. Glibc documents the -1 possibility at http://www.gnu.org/software/libc/manual/html_node/Simple-Calendar-Time.html#Simple-Calendar-Time Microsoft documents the -1 possibility for their libc implementations as well at https://msdn.microsoft.com/en-us/library/1f4c8f33.aspx?f=255&MSPPError=-2147217396 -- You are receiving this mail because: You are the QA Contact for the bug.
samba-bugs at samba.org
2016-Apr-01 02:31 UTC
[Bug 11382] elapsed time calculation does not account for time function possibly returning -1
https://bugzilla.samba.org/show_bug.cgi?id=11382 --- Comment #1 from Brant Gurganus <brant at gurganus.name> --- Created attachment 11958 --> https://bugzilla.samba.org/attachment.cgi?id=11958&action=edit patch indicating unknown bytes/sec if time() returned -1 -- You are receiving this mail because: You are the QA Contact for the bug.
samba-bugs at samba.org
2016-Apr-17 23:13 UTC
[Bug 11382] elapsed time calculation does not account for time function possibly returning -1
https://bugzilla.samba.org/show_bug.cgi?id=11382 Wayne Davison <wayned at samba.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Wayne Davison <wayned at samba.org> --- I have checked-in a fix that outputs "UNKNOWN" for the bytes/sec value if either the start or end time is -1 (see commit d1c80404fece1cd90631ebb687e050deb18acb31). Thanks for the report! -- You are receiving this mail because: You are the QA Contact for the bug.
Possibly Parallel Threads
- [Bug 11369] New: obsoleted autoconf macros
- [Bug 11813] New: m4/socklen_t.m4 uses obsolete AC_TRY_COMPILE macro
- [Bug 11814] New: man-copy Make target missing rsync.1 and rsyncd.conf.5 dependencies
- FIXED_POINT issue
- [Bug 11385] New: calls to functions like close are not wrapped to try again in cases of intermittent interruptions