Bug 877692 - OverflowError: cannot convert float infinity to integer
Summary: OverflowError: cannot convert float infinity to integer
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Samantha N. Bueno
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:4ac0b41b78fe8dc87b72152ec66...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-17 21:46 UTC by Steve Tyler
Modified: 2012-11-30 14:01 UTC (History)
6 users (show)

Fixed In Version: 18.32
Clone Of:
Environment:
Last Closed: 2012-11-30 14:01:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: anaconda-tb (1.55 MB, text/plain)
2012-11-17 21:46 UTC, Steve Tyler
no flags Details
File: environ (882 bytes, text/plain)
2012-11-17 21:46 UTC, Steve Tyler
no flags Details
File: type (9 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: ifcfg.log (641 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: storage.log (870.33 KB, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: version (2 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: program.log (390.59 KB, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: executable (14 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: product (6 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: anaconda.log (67.44 KB, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: hashmarkername (8 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: cmdline_file (162 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: release (33 bytes, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details
File: messages (224.79 KB, text/plain)
2012-11-17 21:47 UTC, Steve Tyler
no flags Details

Description Steve Tyler 2012-11-17 21:46:50 UTC
Description of problem:
Enter a very large number for swap space size:
10000000000000000000000000000...


Version-Release number of selected component:
anaconda-18.29-1.fc18.x86_64

Additional info:
libreport version: 2.0.17
cmdline:        /usr/bin/python  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min --lang en_US.UTF-8
kernel:         3.6.6-3.fc18.x86_64

description:
:The following was filed automatically by anaconda:
:anaconda 18.29 exception report
:Traceback (most recent call first):
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicelibs/lvm.py", line 148, in clampSize
:    return long(round(float(size)/float(pesize)) * pesize)
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devicelibs/lvm.py", line 156, in get_pv_space
:    space = clampSize(size, pesize, roundup=True) + \
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/__init__.py", line 3398, in device_size
:    return get_pv_space(self.size, len(self.disks), **size_func_kwargs)
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/__init__.py", line 1840, in setContainerMembers
:    container_size = factory.device_size
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/__init__.py", line 2104, in newDevice
:    members=members, device=device)
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/custom.py", line 1606, in on_add_clicked
:    disks=disks)
:OverflowError: cannot convert float infinity to integer

Comment 1 Steve Tyler 2012-11-17 21:46:57 UTC
Created attachment 646993 [details]
File: anaconda-tb

Comment 2 Steve Tyler 2012-11-17 21:46:58 UTC
Created attachment 646994 [details]
File: environ

Comment 3 Steve Tyler 2012-11-17 21:47:00 UTC
Created attachment 646995 [details]
File: type

Comment 4 Steve Tyler 2012-11-17 21:47:01 UTC
Created attachment 646996 [details]
File: ifcfg.log

Comment 5 Steve Tyler 2012-11-17 21:47:05 UTC
Created attachment 646997 [details]
File: storage.log

Comment 6 Steve Tyler 2012-11-17 21:47:07 UTC
Created attachment 646998 [details]
File: version

Comment 7 Steve Tyler 2012-11-17 21:47:09 UTC
Created attachment 646999 [details]
File: program.log

Comment 8 Steve Tyler 2012-11-17 21:47:11 UTC
Created attachment 647000 [details]
File: executable

Comment 9 Steve Tyler 2012-11-17 21:47:12 UTC
Created attachment 647001 [details]
File: product

Comment 10 Steve Tyler 2012-11-17 21:47:14 UTC
Created attachment 647002 [details]
File: anaconda.log

Comment 11 Steve Tyler 2012-11-17 21:47:15 UTC
Created attachment 647003 [details]
File: hashmarkername

Comment 12 Steve Tyler 2012-11-17 21:47:16 UTC
Created attachment 647004 [details]
File: cmdline_file

Comment 13 Steve Tyler 2012-11-17 21:47:18 UTC
Created attachment 647005 [details]
File: release

Comment 14 Steve Tyler 2012-11-17 21:47:20 UTC
Created attachment 647006 [details]
File: messages

Comment 15 Samantha N. Bueno 2012-11-19 19:08:30 UTC
Doesn't appear to happen on the net install, only the live cd.

Additionally, this error occurs when setting such a high value for any partition, not just swap.

Comment 16 Steve Tyler 2012-11-19 19:35:23 UTC
Attempting to reproduce Bug 877692 on F18-Beta-TC9 DVD.

Test procedure:
In the capacity box, press '1', then press and hold '0' for about 20 seconds.


Package: anaconda-18.29
OS Release: Fedora release 18-Beta-TC9

Comment 17 Steve Tyler 2012-11-19 19:42:57 UTC
Attempting to reproduce Bug 877692 on F18-Beta-TC9 netinst.

Package: anaconda-18.29
OS Release: Fedora release 18-Beta-TC9

Comment 18 David Lehman 2012-11-19 20:11:54 UTC
In AddDialog.on_add_confirm_clicked and again in CustomPartitioningSpoke._save_right_side we could probably cap the newly proposed/requested size with something along the lines of

  min(sys.maxint, int(newsize)) # newsize here in MB

Comment 19 Steve Tyler 2012-11-20 03:14:18 UTC
Here is a detailed reproducer:

Create an empty 12 GB disc image:
$ qemu-img create f18-test-1.img 12G

Start the installer from the Live CD:
$ qemu-kvm -m 2048 -hda f18-test-1.img -cdrom ~/xfr/fedora/F18/F18-Beta/TC9/Fedora-18-Beta-TC9-x86_64-Live-Desktop.iso -usb -vga qxl -boot menu=on -usbdevice mouse

Click Installation Destination.
Click Continue.
Check "Let me customize ...".
Click Continue.
Click "+" to add a new mount point.
Enter "/" for Mount Point.
Enter a very large integer for Desired Capacity:
    Press "1", then press and hold "0" for about 20 seconds.
Click Add mount point.
Exception occurs: OverflowError: cannot convert float infinity to integer

Tested with:
anaconda-18.29.1-1
Fedora-18-Beta-TC9-x86_64-Live-Desktop.iso

Comment 20 Steve Tyler 2012-11-20 04:25:07 UTC
(In reply to comment #19)
...
> Enter a very large integer for Desired Capacity:
>     Press "1", then press and hold "0" for about 20 seconds.
...

I copied that integer into a gedit window, saved it to a file, and ran "wc" on the file. The integer had 544 digits.

Here is a more precise bound:
>>> 1e308
1e+308
>>> 1e309
inf
>>> int(1e308)
100000000000000001097906362944045541740492309677311846336810682903157585404911491537163328978494688899061249669721172515611590283743140088328307009198146046031271664502933027185697489699588559043338384466165001178426897626212945177628091195786707458122783970171784415105291802893207873272974885715430223118336L
>>> int(1e309)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: cannot convert float infinity to integer
>>>

Comment 21 Steve Tyler 2012-11-20 04:41:45 UTC
(In reply to comment #20)
...
> Here is a more precise bound:
> >>> 1e308
> 1e+308
> >>> 1e309
> inf

>>> sys.float_info.max
1.7976931348623157e+308

http://docs.python.org/2.7/library/sys.html#sys.float_info

Comment 22 Samantha N. Bueno 2012-11-30 14:01:17 UTC
Should be fixed now in version 18.32 (F18-TC1). Users should be presented with an error message and the chance to edit their mmistake if they try entering obscenely large values now.


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