Bug 57962

Summary: division by zero error in up2date on very fast machine
Product: [Retired] Red Hat Linux Reporter: Frank Ch. Eigler <fche>
Component: up2dateAssignee: Adrian Likins <alikins>
Status: CLOSED CURRENTRELEASE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: gafton, mihai.ibanescu, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-22 12:38:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Ch. Eigler 2002-01-03 16:00:15 UTC
Description of Problem:

On a very fast alpha box, running up2date (2.7.11-7.x.1) on a small
job ("--justdb FILE") can cause a division-by-zero abort during a
progress-indicator calculation.  The Python traceback:


Traceback (innermost last):
  File "/usr/sbin/up2date", line 1014, in ?
    main()
  File "/usr/sbin/up2date", line 341, in main
    sys.exit(batchRun(argObj.getLong("list"), pkgNames, fullUpdate))
  File "/usr/sbin/up2date", line 959, in batchRun
    up2date.getPackage(pkg, printPkg, printRetrieveHash)
  File "/usr/share/rhn/up2date_client/up2date.py", line 956, in getPackage
    buffer = doCall(packageSource.getPackage, pkg, msgCallback,
progressCallback)
  File "/usr/share/rhn/up2date_client/up2date.py", line 287, in doCall
    ret = apply(method, args, kwargs)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 98, in getPackage
    package = source.getPackage(pkg, MsgCallback, progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 499, in getPackage
    buffer = self._readFD(fd, size, filePath, progressCallback =
progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 435, in _readFD
    speed = bytesRead / (curTime - startTime)
ZeroDivisionError: float division

Comment 1 Adrian Likins 2002-01-16 21:31:51 UTC
added a epsilon in there to prevent divide by zero

Comment 2 Matt Jamison 2003-05-22 12:38:40 UTC
closing bug.