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
Segmentation fault in bytearray tests #49185
Comments
This happens on a 32-bit build on a 64-bit system, which happens to have The crash is exactly triggered by the following snippet: if sys.maxsize < (1 << 32) and struct.calcsize('P') == 4:
self.assertRaises(OverflowError,
self.marshal(b'\ta\n\tb').expandtabs,
sys.maxsize) |
Here is a patch. The idea is to use unsigned arithmetic instead of (the exact reason of the crash is unknown, it looks like either a |
What's the purpose of old_i? It looks like it's never used for anything. Other than than, the patch looks good to me. I'd guess that the "if (i < 0)" was simply optimized away. This isn't Also, it would be nice to cleanup the whitespace in this function while |
Actually, what's the purpose of old_j? It looks like that's not needed |
You are right, old_i and old_j are unused, they were part of another |
Looks fine; I think this should be applied. It seems as though your reindentation left trailing whitespace on |
Committed in trunk, py3k, 2.6 and 3.0. Thanks! |
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: