[NumPy-Tickets] [NumPy] #1689: fromstring segfaults if reading from text and dtype=bool_

NumPy Trac numpy-tickets@scipy....
Fri Dec 3 03:03:47 CST 2010


#1689: fromstring segfaults if reading from text and dtype=bool_
--------------------+-------------------------------------------------------
 Reporter:  gerrit  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  high    |   Milestone:  2.0.0   
Component:  Other   |     Version:  devel   
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by blyth):

 {{{
 [blyth@cms01 ~]$ gdb $(which python)
 GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "i386-redhat-linux-gnu"...Using host
 libthread_db library "/lib/tls/libthread_db.so.1".

 (gdb) set args -c 'import numpy as np ;  print np.version.version ; a =
 np.fromstring("1 1", sep=" ", dtype=np.bool_) '
 (gdb) r
 Starting program: /data/env/system/python/Python-2.5.1/bin/python -c
 'import numpy as np ;  print np.version.version ; a = np.fromstring("1 1",
 sep=" ", dtype=np.bool_) '
 [Thread debugging using libthread_db enabled]
 [New Thread -1208583520 (LWP 32368)]
 2.0.0.dev-6aacc2d

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread -1208583520 (LWP 32368)]
 0x00000000 in ?? ()
 (gdb) bt
 #0  0x00000000 in ?? ()
 #1  0x0013f2d3 in fromstr_next_element (s=0xbff345e8, dptr=0x83a2fe0,
 dtype=0x1943c0, end=0xb7f0f077 "") at numpy/core/src/multiarray/ctors.c:39
 #2  0x00141a75 in array_from_text (dtype=0x1943c0, num=-1, sep=0xb7f0f094
 " ", nread=0xbff34608, stream=0xb7f0f074, next=0x13f2b8
 <fromstr_next_element>, skip_sep=0x13f30c <fromstr_skip_separator>,
 stream_data=0xb7f0f077) at numpy/core/src/multiarray/ctors.c:3077
 #3  0x00142170 in PyArray_FromString (data=0xb7f0f074 "1 1", slen=3,
 dtype=0x1943c0, num=-1, sep=0xb7f0f094 " ") at
 numpy/core/src/multiarray/ctors.c:3396
 #4  0x0018266e in array_fromstring (__NPY_UNUSED_TAGGEDignored=0x0,
 args=0xb7f515cc, keywds=0xb7b6d824) at
 numpy/core/src/multiarray/multiarraymodule.c:1739
 #5  0x002e4b7a in PyCFunction_Call (func=0xb7f1bf2c, arg=0xb7f515cc,
 kw=0xb7b6d824) at Objects/methodobject.c:108
 #6  0x002b431c in PyObject_Call (func=0x838c9f8, arg=0xb7f515cc,
 kw=0xb7b6d824) at Objects/abstract.c:1860
 #7  0x00328c94 in PyEval_EvalFrameEx (f=0x817dd8c, throwflag=0) at
 Python/ceval.c:3775
 #8  0x0032eead in PyEval_EvalCodeEx (co=0xb7eff7b8, globals=0xb7f3facc,
 locals=0xb7f3facc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
 defcount=0, closure=0x0) at Python/ceval.c:2831
 #9  0x0032f03b in PyEval_EvalCode (co=0xb7eff7b8, globals=0xb7f3facc,
 locals=0xb7f3facc) at Python/ceval.c:494
 #10 0x0034f198 in PyRun_StringFlags (str=0x816c008 "import numpy as np ;
 print np.version.version ; a = np.fromstring(\"1 1\", sep=\" \",
 dtype=np.bool_) \n", start=257, globals=0xb7f3facc, locals=0xb7f3facc,
 flags=0xbff34a7c) at Python/pythonrun.c:1271
 #11 0x0034f907 in PyRun_SimpleStringFlags (command=0x816c008 "import numpy
 as np ;  print np.version.version ; a = np.fromstring(\"1 1\", sep=\" \",
 dtype=np.bool_) \n", flags=0xbff34a7c) at Python/pythonrun.c:898
 #12 0x0035adec in Py_Main (argc=1, argv=0xbff34bb4) at Modules/main.c:512
 #13 0x080485aa in main (argc=3, argv=0xbff34bb4) at ./Modules/python.c:23
 (gdb)

 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1689#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list