[Numpy-tickets] [NumPy] #469: Memory error: string concatenation
NumPy
numpy-tickets@scipy....
Sat Mar 17 10:29:34 CDT 2007
#469: Memory error: string concatenation
------------------------+---------------------------------------------------
Reporter: stefan | Owner: oliphant
Type: defect | Status: new
Priority: normal | Milestone:
Component: numpy.core | Version: devel
Severity: normal | Keywords:
------------------------+---------------------------------------------------
With r3580, the following code produces a memory error:
{{{
import numpy as N
x = N.array([])
N.append(x,'asdasd\tasdasd')
}}}
Valgrind says:
{{{
==9184== Invalid write of size 1
==9184== at 0x4022CE2: memcpy (mc_replace_strmem.c:405)
==9184== by 0x463D5E4: PyArray_Concatenate (multiarraymodule.c:1596)
==9184== by 0x463D71E: array_concatenate (multiarraymodule.c:6277)
==9184== by 0x805A0B6: PyObject_Call (in /usr/bin/python2.5)
==9184== by 0x80BE4E9: PyEval_EvalFrameEx (in /usr/bin/python2.5)
==9184== by 0x80C37F4: PyEval_EvalCodeEx (in /usr/bin/python2.5)
==9184== by 0x80C183D: PyEval_EvalFrameEx (in /usr/bin/python2.5)
==9184== by 0x80C37F4: PyEval_EvalCodeEx (in /usr/bin/python2.5)
==9184== by 0x80C3866: PyEval_EvalCode (in /usr/bin/python2.5)
==9184== by 0x80E2EEB: PyRun_FileExFlags (in /usr/bin/python2.5)
==9184== Address 0x43FCFE1 is 1 bytes after a block of size 8 alloc'd
==9184== at 0x4021396: malloc (vg_replace_malloc.c:149)
==9184== by 0x4629CD4: PyArray_NewFromDescr (arrayobject.c:5386)
==9184== by 0x463D56B: PyArray_Concatenate (multiarraymodule.c:1584)
==9184== by 0x463D71E: array_concatenate (multiarraymodule.c:6277)
==9184== by 0x805A0B6: PyObject_Call (in /usr/bin/python2.5)
==9184== by 0x80BE4E9: PyEval_EvalFrameEx (in /usr/bin/python2.5)
==9184== by 0x80C37F4: PyEval_EvalCodeEx (in /usr/bin/python2.5)
==9184== by 0x80C183D: PyEval_EvalFrameEx (in /usr/bin/python2.5)
==9184== by 0x80C37F4: PyEval_EvalCodeEx (in /usr/bin/python2.5)
==9184== by 0x80C3866: PyEval_EvalCode (in /usr/bin/python2.5)
}}}
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/469>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list