[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed in r80926 (trunk), r80927 (2.6), r80928 (py3k) and r80929 (3.1). Thank you! -- ___ Python tracker ___ _

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Is there a reason to keep inplen and max_length ints instead of making > them Py_ssize_t too? zlibmodule.c isn't 64-bit clean internally. Actually, the zlib itself uses uInt in its z_stream structure. This should be the target of a separate issue, and seems i

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Denis Dmitriev
Denis Dmitriev added the comment: Is there a reason to keep inplen and max_length ints instead of making them Py_ssize_t too? I'm a little worried that keeping them ints will cause a similar problem further down the line. -- ___ Python tracker

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > in the unittests there is some use of 'compress' and 'decompress' > mixed with 'zlib.decompress'. which one is right When testing the decompressor, data needs to be prepared first (compressed). I didn't bother creating a compressor object in this case.

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Gregory P. Smith
Gregory P. Smith added the comment: in the unittests there is some use of 'compress' and 'decompress' mixed with 'zlib.decompress'. which one is right (i'm only looking at the diff so i can't see if they were imported from zlib or if the zlib. is required at the moment). otherwise, provided th

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch fixing the issue, and a similar one in compressobj.compress(). It also adds tests which are only enabled with the bigmem option. -- Added file: http://bugs.python.org/file17245/zlibbigbuf.patch ___ P

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Confirmed. It even segfaults under 3.x. -- nosy: +pitrou priority: normal -> high stage: -> patch review versions: +Python 2.7, Python 3.1 ___ Python tracker _

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-05-07 Thread Sreejith Madhavan
Sreejith Madhavan added the comment: Attached a patch for Modules/zlibmodule.c that worked for me. Tested with python (2.6.1 and 2.6.5) 64bit builds on Solaris (amd64 and sparc) and RHEL5.2 amd64. -- keywords: +patch nosy: +Sreejith.Madhavan Added file: http://bugs.python.org/file172

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-04-29 Thread Denis Dmitriev
Denis Dmitriev added the comment: Alright, I think this is caused by the following: static PyObject * PyZlib_objdecompress(compobject *self, PyObject *args) { int err, inplen, old_length, length = DEFAULTALLOC; int max_length = 0; The problem is that inplen, length, old_length, and max

[issue8571] zlib causes a SystemError when decompressing a chunk >1GB

2010-04-29 Thread Denis Dmitriev
New submission from Denis Dmitriev : There's a bug in python's zlibmodule.c that makes it raise SystemError whenever it tries to decompress a chunk larger than 1GB is size. Here's an example of this in action: dmitr...@...:~/moo/zlib_bug> cat zlib_bug.py import zlib def test_zlib(size_mb):