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.product #67553
Comments
# Bug import itertools as it
args=["a"]*(2**16)
it.product(*args, repeat=2**16) |
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': |
+ with self.assertRaises(OverflowError): The test needs 16GiB. May be use repeat=2**13? |
Why do you think this test needs 16GiB? |
2**16 * 2**16 * sizeof(Py_ssize_t) = 16GiB |
You mean 64bit? On 32 it'll overflow and that's the point. |
Oh, and actually the test is wrong. It fails on 32-bit with -M2G. Should be: - with self.assertRaises(OverflowError):
- product(["a"]*(2**16), repeat=2**16)
+ with self.assertRaises((OverflowError, MemoryError)):
+ product(*(['ab']*2**5), repeat=2**25) |
And this means that this test (and other tests with the bigaddrspacetest decorator) is not executed on any of our buildbots. It skipped on 64-bit builders and 32-bit builders ran tests without the -M2G option. |
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': |
New changeset 887526ebb013 by Serhiy Storchaka in branch '2.7': |
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: