Comment 0 for bug 933993

Revision history for this message
Chris Hoge (hoge) wrote : glance add can fail for images larger than 2 GB on some Python installations (RHEL 6.1)

Some Python installations, in particular for RHEL 6.1 Python 2.6, that are not 64 bit clean "glance add" will fail. For example, where testimage.img is larger than 2GB

glance --debug add name="testimage" disk_format=raw is_public=true < testimage.img
python: Objects/fileobject.c:2117: readahead_get_line_skip: Assertion `skip+len < 2147483647' failed.

The underlying problem is a INT_MAX macro in the fileobject.c method 'readahead_get_line_skip' uses a 32 bit value instead of a 64 bit value. The Python file iterator eventually calls down to this method, which causes a crash for large file sizes.

A workaround for RHEL users is to comment out the "elif self._iterable(body):" section for the image_iterator method in glance/common/client.py and fall back to the ImageBodyIterator.

While not directly a bug with Glance, it does impact a subset of users not running Ubuntu systems.