Bug 877692

Summary: OverflowError: cannot convert float infinity to integer
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: anacondaAssignee: Samantha N. Bueno <sbueno>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: anaconda-maint-list, g.kaviyarasu, jonathan, sbueno, stephent98, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4ac0b41b78fe8dc87b72152ec66126325d39c524903f4a363331d4d4b5936f83
Fixed In Version: 18.32 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-30 14:01:17 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:
Attachments:
Description Flags
File: anaconda-tb
none
File: environ
none
File: type
none
File: ifcfg.log
none
File: storage.log
none
File: version
none
File: program.log
none
File: executable
none
File: product
none
File: anaconda.log
none
File: hashmarkername
none
File: cmdline_file
none
File: release
none
File: messages none

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.