[Numpy-discussion] More SPARC pain

Matthew Brett matthew.brett@gmail....
Tue Mar 6 22:07:53 CST 2012


Hi,

I found this test caused a bus error on current trunk:

<pre>
import numpy as np

from StringIO import StringIO as BytesIO

from numpy.testing import assert_array_equal


def test_2d_buf():
    dtt = np.complex64
    arr = np.arange(10, dtype=dtt)
    # 2D array
    arr2 = np.reshape(arr, (2, 5))
    # Fortran write followed by (C or F) read caused bus error
    data_str = arr2.tostring('F')
    data_back = np.ndarray(arr2.shape,
                           arr2.dtype,
                           buffer=data_str,
                           order='F')
    assert_array_equal(arr2, data_back)
</pre>

gdb run gives ...

test_me3.test_2d_buf ...
Program received signal SIGBUS, Bus error.
0xf78f5458 in _aligned_strided_to_contig_size8 (
    dst=0xdc0e08
"\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\313\373\373\373\373",
dst_stride=8, src=0xcdfc44 "", src_stride=16, N=5,
__NPY_UNUSED_TAGGEDsrc_itemsize=8,
    __NPY_UNUSED_TAGGEDdata=0x0) at
numpy/core/src/multiarray/lowlevel_strided_loops.c.src:137
137             (*((@type@ *)dst)) = @swap@@elsize@(*((@type@ *)src));

Debug log attached.  Shall I make an issue?

Best,

Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buf_2d.log.gz
Type: application/x-gzip
Size: 7956 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120307/b1f08dd7/attachment-0001.gz 


More information about the NumPy-Discussion mailing list