Closed numpy-gitbot closed 12 years ago
trac user ocertik wrote on 2012-08-31
This now gives:
(py27)ondrejatmention:hawk:~/repos/numpy/tools(fix369)$ python -c "import numpy as np; a = np.array([('a', 1)], dtype='S1, int'); np.searchsorted(a, 1.2)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ondrej/repos/numpy/py27/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 814, in searchsorted
return searchsorted(v, side, sorter)
TypeError: invalid type promotion
I am now working on a test and I'll submit a PR soon.
trac user ocertik wrote on 2012-08-31
trac user ocertik wrote on 2012-09-20
Patch merged, closing.
Original ticket http://projects.scipy.org/numpy/ticket/2189 on 2012-07-23 by trac user akhmerov, assigned to unknown.
numpy.searchsorted causes segfault when one searches in a structured array with a wrong dtype.
Bug is reproduced by: python -c "import numpy as np; a = np.array([('a', 1)], dtype='S1, int'); np.searchsorted(a, 1.2)"
gdb traceback:
0 0x00007ffff5d63413 in ?? () from /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so
1 0x00007ffff5d736a9 in ?? () from /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so
2 0x000000000042a485 in PyEval_EvalFrameEx ()
3 0x00000000004317f2 in PyEval_EvalCodeEx ()
4 0x000000000042a998 in PyEval_EvalFrameEx ()
5 0x00000000004317f2 in PyEval_EvalCodeEx ()
6 0x000000000042a136 in PyRun_StringFlags ()
7 0x0000000000432209 in PyRun_SimpleStringFlags ()
8 0x000000000054c41a in Py_Main ()
9 0x00007ffff68e576d in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
10 0x000000000041b931 in _start ()