Bug 678253 - Anaconda dies with ZeroDivisionError when installing less than 1kB
Summary: Anaconda dies with ZeroDivisionError when installing less than 1kB
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 13
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-17 09:50 UTC by Hynek Bures
Modified: 2011-03-08 20:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-08 20:18:52 UTC
Type: ---


Attachments (Terms of Use)

Description Hynek Bures 2011-02-17 09:50:38 UTC
In Anacoda 13.42, when the total size of all packages being installed is less then 1kB, Anaconda crashes:

anaconda 13.42 exception report
Traceback (most recent call first):
File "/usr/lib/anaconda/yuminstall.py", line
219, in callback
self.progress.set_fraction(float(self.doneSize
/ self.totalSize))
ZeroDivisionError: float division 

The totalSize variable is calculated as a total number of kilobytes to be installed. If the size of the package is less than 1024 bytes, the division by 1024 returns zero (an integer division is used).

We have patched Anaconda to always make the total size non-zero:


*** yuminstall.py       2010-05-07 03:11:33.000000000 -0400
--- yuminstall_backup.py        2011-02-16 06:21:37.602888749 -0500
***************
*** 216,221 ****
--- 216,223 ----
                                            self.numpkgs)
                                         % {'donepkgs': self.donepkgs,
                                            'numpkgs': self.numpkgs})
+             if self.totalSize < 1:                                      
+                 self.totalSize = 1
              self.progress.set_fraction(float(self.doneSize / self.totalSize))
              self.progress.processEvents()

Comment 1 Chris Lumens 2011-03-08 20:18:52 UTC
anaconda is an operating system installer, not a single package installer.  You should not be hitting cases where the total size of all packages being installed is this small.


Note You need to log in before you can comment on or make changes to this bug.