Re: [Numpy-discussion] Yet another problem in CVS numarray

Francesc Altet wrote:
El dv 04 de 11 del 2005 a les 15:35 -0500, en/na Todd Miller va escriure:
This turned out to be a problem with the way numarray handles Numeric's multi-segment buffer protocol. I worked around this by implementing David Cooke's __array_struct__ array interface for numarray.
Did you commit the changes in CVS? I'm getting the same problems with the current CVS version:
Numeric.__version__
'24.1'
import numarray numarray.__version__
'1.4.2'
num=Numeric.array([1,2,3,4]) numarray.array(num)
array([1, 2, 3, 4])
num2=num[::2] numarray.array(num2)
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 380, in array a = a.astype(type) File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 867, in astype return self.copy() File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 927, in copy c = _gen.NDArray.copy(self) File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in copy arr._itemsize) numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=11 buffersize=8
This turned out to be a bug in numarray buffer size determination... striding wasn't accounted for so the buffer appeared to be too small. It's fixed now in CVS. There's still a backward compatibility problem for old Numerics which don't implement __array_struct__ and get multi-segment buffers through __array_data__. Regards, Todd

Ups, I've made a cvs update and not luck yet:
import numarray; numarray.__version__ '1.4.2' import Numeric; Numeric.__version__ '24.1' num=Numeric.array([1,2,3,4]) numarray.array(num) array([1, 2, 3, 4]) num2=num[::2] numarray.array(num2) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 380, in array a = a.astype(type) File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 867, in astype return self.copy() File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 927, in copy c = _gen.NDArray.copy(self) File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in copy arr._itemsize) numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=11 buffersize=8
I've made a rm -rf of old numarray extension, and rebuild everything from scratch. Regards, A Dijous 10 Novembre 2005 17:47, vàreu escriure:
Francesc Altet wrote:
El dv 04 de 11 del 2005 a les 15:35 -0500, en/na Todd Miller va
escriure:
This turned out to be a problem with the way numarray handles Numeric's multi-segment buffer protocol. I worked around this by implementing David Cooke's __array_struct__ array interface for numarray.
Did you commit the changes in CVS? I'm getting the same problems with
the current CVS version:
Numeric.__version__
'24.1'
import numarray numarray.__version__
'1.4.2'
num=Numeric.array([1,2,3,4]) numarray.array(num)
array([1, 2, 3, 4])
num2=num[::2] numarray.array(num2)
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 380, in array a = a.astype(type) File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 867, in astype return self.copy() File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 927, in copy c = _gen.NDArray.copy(self) File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in copy arr._itemsize) numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=11 buffersize=8
This turned out to be a bug in numarray buffer size determination... striding wasn't accounted for so the buffer appeared to be too small. It's fixed now in CVS. There's still a backward compatibility problem for old Numerics which don't implement __array_struct__ and get multi-segment buffers through __array_data__.
Regards, Todd
--
0,0< Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data "-"

Francesc Altet wrote:
Ups, I've made a cvs update and not luck yet:
import numarray; numarray.__version__
'1.4.2'
import Numeric; Numeric.__version__
'24.1'
num=Numeric.array([1,2,3,4]) numarray.array(num)
array([1, 2, 3, 4])
num2=num[::2] numarray.array(num2)
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 380, in array a = a.astype(type) File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 867, in astype return self.copy() File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 927, in copy c = _gen.NDArray.copy(self) File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in copy arr._itemsize) numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=11 buffersize=8
I've made a rm -rf of old numarray extension, and rebuild everything from scratch.
Regards,
A Dijous 10 Novembre 2005 17:47, vàreu escriure:
Francesc Altet wrote:
El dv 04 de 11 del 2005 a les 15:35 -0500, en/na Todd Miller va
escriure:
This turned out to be a problem with the way numarray handles Numeric's multi-segment buffer protocol. I worked around this by implementing David Cooke's __array_struct__ array interface for numarray.
Did you commit the changes in CVS? I'm getting the same problems with
the current CVS version:
Numeric.__version__
'24.1'
import numarray numarray.__version__
'1.4.2'
num=Numeric.array([1,2,3,4]) numarray.array(num)
array([1, 2, 3, 4])
num2=num[::2] numarray.array(num2)
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 380, in array a = a.astype(type) File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 867, in astype return self.copy() File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 927, in copy c = _gen.NDArray.copy(self) File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in copy arr._itemsize) numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=11 buffersize=8
So you're still seeing it? Does the attached work for you? Keep in mind, anonymous CVS lags on Source Forge.
This turned out to be a bug in numarray buffer size determination... striding wasn't accounted for so the buffer appeared to be too small. It's fixed now in CVS. There's still a backward compatibility problem for old Numerics which don't implement __array_struct__ and get multi-segment buffers through __array_data__.
Regards, Todd

A Dijous 10 Novembre 2005 18:54, Todd Miller va escriure:
So you're still seeing it? Does the attached work for you?
Nope.
Keep in mind, anonymous CVS lags on Source Forge.
Oh yes. I forgot about this :-/. I'll try it again tomorrow... --
0,0< Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data "-"
participants (2)
-
Francesc Altet
-
Todd Miller