-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Python crash on access to the result of numpy.fromfile #17819
Copy link
Copy link
Closed
Milestone
Description
Python crashes on access to array read from a file, in case count is above file size (and probably some other restrictions - not all combinations of file size, count and offset result in crash. The one below was verified to crash on two different computers).
Provided dtype also seems to be an important factor.
Reproducing code example:
import numpy as np
np.zeros(511).tofile('testfile')
print(np.fromfile('testfile', dtype=np.dtype((np.int32, 2)), count = 100000))Error message:
Python crash due to memory access violation
NumPy/Python version information:
1.17.4 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
Reactions are currently unavailable