[NumPy-Tickets] [NumPy] #2019: concatenate() segfaults on dict_values (Python 3)
NumPy Trac
numpy-tickets@scipy....
Sun Jan 15 06:31:00 CST 2012
#2019: concatenate() segfaults on dict_values (Python 3)
------------------------+---------------------------------------------------
Reporter: takluyver | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.1
Keywords: python3 |
------------------------+---------------------------------------------------
Steps to reproduce:
{{{
In [1]: import numpy as np
In [2]: np.__version__
Out[2]: '1.6.1'
In [3]: d = {1:np.ones(5), 2:np.zeros(5)}
In [4]: np.concatenate(d.values())
Segmentation fault
}}}
gdb output:
{{{
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/thomas/Code/virtualenvs/pymc3/bin/python3...(no
debugging symbols found)...done.
(gdb) run -c "import numpy as np;d = {1:np.ones(5),
2:np.zeros(5)};np.concatenate(d.values())"
Starting program: /home/thomas/Code/virtualenvs/pymc3/bin/python3 -c
"import numpy as np;d = {1:np.ones(5),
2:np.zeros(5)};np.concatenate(d.values())"
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
PyArray_ConvertToCommonType (op=0x8aa0584, retn=0xbfffee4c)
at numpy/core/src/multiarray/convert_datatype.c:1515
1515 if (!PyArray_CheckAnyScalar(otmp)) {
(gdb) c
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
}}}
This is with Python 3.2.2 on 32-bit Linux. Converting it to a list works
fine:
{{{
In [3]: np.concatenate(list(d.values()))
Out[3]: array([ 1., 1., 1., 1., 1., 0., 0., 0., 0., 0.])
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2019>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list