You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python 3 interpreter has an internal cache of single-byte bytes objects, from which objects are retrieved in a few operations, notably computing length-1 slices of bytes objects. Pickling and unpickling certain arrays can give direct write-access into that cache. A simple way to reproduce the problem is:
This applies not only to master, but also to released versions, e.g. to Ubuntu 12.04's python3-numpy, which has numpy 1.6.1 and Python 3.2.3.
A similar problem has apparently been encountered before, as the test suite has test_pickle_string_overwrite() in numpy/core/tests/test_regression.py, which triggers the cache corruption but doesn't detect it.
The text was updated successfully, but these errors were encountered:
Relevant source code location: numpy/core/src/multiarray/methods.c:1588
The comment /* Bytes are never interned */ there is invalid.
The fix is one-liner, just take the branch unconditionally.
The Python 3 interpreter has an internal cache of single-byte bytes objects, from which objects are retrieved in a few operations, notably computing length-1 slices of bytes objects. Pickling and unpickling certain arrays can give direct write-access into that cache. A simple way to reproduce the problem is:
This applies not only to master, but also to released versions, e.g. to Ubuntu 12.04's python3-numpy, which has numpy 1.6.1 and Python 3.2.3.
A similar problem has apparently been encountered before, as the test suite has
test_pickle_string_overwrite()
innumpy/core/tests/test_regression.py
, which triggers the cache corruption but doesn't detect it.The text was updated successfully, but these errors were encountered: