Open numpy-gitbot opened 11 years ago
atmention:rgommers wrote on 2010-07-18
Asking this on the mailing list will probably get you an answer. Here it probably won't any time soon.
atmention:mwiebe wrote on 2011-03-25
This looks like a bug to me - data should be a read-only attribute of the array class. This crashes for me in 1.6 beta.
Milestone changed to NumPy 2.0
by atmention:mwiebe on 2011-03-25
Title changed from memory corruption by ndarray_instance.data assignment
to memory corruption by ndarray_instance.data assignment (data should be made readonly)
by atmention:mwiebe on 2011-03-25
Original ticket http://projects.scipy.org/numpy/ticket/1275 on 2009-10-25 by trac user mcieslik, assigned to unknown.
It's probably not a bug, but I'd like to ask for clarification. I try to make two arrays share memory. I create big array from small arrays (this involves a copy e.g. by vstack). Create slice/views of the big array corresponding to the small arrays and do a array.data assignment i.e.:
This works, both arrays can now modify the same memory, but is not safe as it can lead to memory corruption (see below). My first question: is this considered very very bad practice and if so how to point an ndarray instance to a new memory safely.