[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2020-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2020-10-16 Thread Irit Katriel
Irit Katriel added the comment: Can this be closed? -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset aaed2c332ae8370e5e87d09c43ef7a39c2abf68d by Victor Stinner in branch '2.7': bpo-26423: Fix test_descr.test_wrap_lenfunc_bad_cast() on 32-bit Windows (GH-13629) https://github.com/python/cpython/commit/aaed2c332ae8370e5e87d09c43ef7a39c2abf68d

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13529 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/13629 ___ Python tracker ___ __

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: Oh. The test fails on Python 2.7 on Windows: https://buildbot.python.org/all/#/builders/26/builds/287 ERROR: test_wrap_lenfunc_bad_cast (test.test_descr.OperatorsTest) -- Traceback (most rece

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: Thanks Zackery Spytz for the fix. It's now applied to 2.7, 3.7 and master branches. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 80dfe990162e7a2dd99524829beecd449a973e9e by Victor Stinner in branch '2.7': bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) (GH-13625) https://github.com/python/cpython/commit/80dfe990162e7a2dd99524829beecd449a973e9e --

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +13524 pull_request: https://github.com/python/cpython/pull/13625 ___ Python tracker ___ __

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread miss-islington
miss-islington added the comment: New changeset e7ddf586ae5b7a3b975103b09c8202226d77f421 by Miss Islington (bot) in branch '3.7': bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) https://github.com/python/cpython/commit/e7ddf586ae5b7a3b975103b09c8202226d77f421 -- nosy:

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker ___ __

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread miss-islington
Change by miss-islington : -- pull_requests: +13522 pull_request: https://github.com/python/cpython/pull/13622 ___ Python tracker ___ __

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 05f16416d99dc9fc76fef11e56f16593e7a5955e by Victor Stinner (Zackery Spytz) in branch 'master': bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) https://github.com/python/cpython/commit/05f16416d99dc9fc76fef11e56f16593e7a5955e

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2019-05-27 Thread Zackery Spytz
Change by Zackery Spytz : -- pull_requests: +13512 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/13606 ___ Python tracker ___

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2017-04-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you create a PR for your patch Victor? -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With fixed issue26428 you could use xrange() for testing this issue. -- ___ Python tracker ___ ___

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Eryk Sun
Eryk Sun added the comment: > the sq_length slot in the weakproxy type is set to proxy_length. Nice. Its tp_getattro gets in the way of using __len__ directly, but this can be side stepped by manually binding the descriptor: class Test(object): def __len__(self): return

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > xrange() constructor is implemented in C and looks to use C long for > parameters. This issue is specific to 64-bit Windows with 32-bit C long, so > xrange() doesn't seem to work here. What about xrange(-1, 2**31-1)? In any case the fact that xrange works no

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread STINNER Victor
STINNER Victor added the comment: > mmap.mmap(-1, 2**31 + 5) could be used here. Yeah, I hesitated to use mmap, but I'm not really a big fan of using directly a mmap object in test_descr. Unit tests are supposed to only test one thing. > If the pages are never touched it won't increase the wo

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Eryk Sun
Eryk Sun added the comment: mmap.mmap(-1, 2**31 + 5) could be used here. If the pages are never touched it won't increase the working set size. It merely maps the address range with demand-zero pages. Unpatched: >>> mmap.mmap(-1, 2**31 + 5).__len__() -2147483643 Patched: >>> mma

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread STINNER Victor
STINNER Victor added the comment: > Could we use the xrange() object for testing? xrange() constructor is implemented in C and looks to use C long for parameters. This issue is specific to 64-bit Windows with 32-bit C long, so xrange() doesn't seem to work here. > Or weakref? What do you me

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Using a bigmem test for this issue looks excessive. Could we use the xrange() object for testing? Or weakref? -- ___ Python tracker ___ _

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread STINNER Victor
STINNER Victor added the comment: > Could you write a test? Done. -- Added file: http://bugs.python.org/file42020/wrap_lenfunc-2.patch ___ Python tracker ___ ___

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you write a test? May be on 3.x you can use range(sys.maxsize).__len__(). -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2016-02-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: Integer overflow in wrap_lenfunc() on 64-bit build of Windows -> Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1 ___ Python tracker __

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows

2016-02-24 Thread STINNER Victor
STINNER Victor added the comment: > You need to call `x.__len__()` explicitly. Ah ok :-) I didn't read carefully the initial message. Attached patch should fix the issue on Python 2.7. It uses the same function than builtin_len() to cast the C Py_ssize_t to a Python int or long. -- ke

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows

2016-02-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: __len__() returns 32 bit int on windows leading to overflows -> Integer overflow in wrap_lenfunc() on 64-bit build of Windows ___ Python tracker __