New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integer overflow in itertools.permutations #67552
Comments
# Bug #
# % ./python -V
# Python 3.4.1
#
# % uname -a
# Linux ubuntu 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux
#
import itertools as it
it.permutations("A", 2**30) |
New changeset 7133582b6769 by Benjamin Peterson in branch '3.3': New changeset 9ae055c3db32 by Benjamin Peterson in branch '3.4': New changeset 31dc5a40d2ab by Benjamin Peterson in branch 'default': New changeset acc2c3479f2e by Benjamin Peterson in branch '2.7': |
An overflow in n * sizeof(Py_ssize_t) is not possible because n is the length of already allocated array of pointers. + with self.assertRaises(OverflowError): The test needs 4GiB. May be use 2**29? + with self.assertRaises(OverflowError): permutations() takes at most 2 arguments. |
New changeset 356ed025dbae by Serhiy Storchaka in branch '3.3': New changeset 98c720c3e061 by Serhiy Storchaka in branch '3.4': New changeset 4cb316fe6bf2 by Serhiy Storchaka in branch 'default': |
The last fix should be applied also in 2.7 branch. |
New changeset 887526ebb013 by Serhiy Storchaka in branch '2.7': |
Thanks Arfrever. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: