[NumPy-Tickets] [NumPy] #1756: Segfault when recasting string arrays

NumPy Trac numpy-tickets@scipy....
Sat Mar 5 05:12:42 CST 2011


#1756: Segfault when recasting string arrays
--------------------+-------------------------------------------------------
 Reporter:  faltet  |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  devel      
 Keywords:          |  
--------------------+-------------------------------------------------------
 The next makes the segfault to happen:

 {{{
 import numpy as np

 arr = np.array(['1', '12', '123', '1234', '12345'])
 nparr = np.array(arr, dtype="|S3")
 }}}

 Valgrind shows this:

 {{{
 ==27003== Invalid write of size 1
 ==27003==    at 0x4C2860D: memcpy (mc_replace_strmem.c:402)
 ==27003==    by 0x62746A7: _strided_to_contig
 (lowlevel_strided_loops.c.src:311)
 ==27003==    by 0x62B8D09: PyArray_CopyInto (ctors.c:2645)
 ==27003==  Address 0x6e58522 is 3 bytes after a block of size 15 alloc'd
 ==27003==    at 0x4C279AE: malloc (vg_replace_malloc.c:207)
 ==27003==    by 0x62ABA66: PyArray_NewFromDescr (ctors.c:1013)
 ==27003==    by 0x61E84FF: ???
 ==27003==    by 0x93B18CF: ???
 ==27003==    by 0x61E84AF: ???
 ==27003==    by 0x6206FCF: ???
 }}}

 This happens with current master in numpy-1.6.0.dev_5aa65d9

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1756>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list