[Numpy-discussion] test_multiarray.TestIO.test_ascii segmentation fault with Python2.7

Bruce Southey bsouthey@gmail....
Tue Dec 15 10:36:03 CST 2009


On 12/15/2009 10:07 AM, Pauli Virtanen wrote:
> Hi,
>
> Tue, 15 Dec 2009 09:30:08 -0600, Bruce Southey wrote:
>    
>> After installing Python2.7, a patched nose
>> (http://bitbucket.org/kumar303/nose-2_7_fixes/ because
>> unittest._TextTestResult has been removed) and numpy '1.5.0.dev8011',
>> numpy.test crashes with a segmentation fault with the test for:
>> test_multiarray.TestIO.test_ascii
>>
>> If I understand the test correctly:
>> $ python
>> Python 2.7a1 (r27a1:76674, Dec 14 2009, 13:46:01) [GCC 4.4.1 20090725
>> (Red Hat 4.4.1-2)] on linux2 Type "help", "copyright", "credits" or
>> "license" for more information.
>>   >>>  import numpy as np
>>   >>>  from numpy.compat import asbytes, getexception
>>   >>>  np.fromstring(asbytes('1 , 2 , 3 , 4'),sep=',')
>> Segmentation fault
>>      
> Please run it under gdb to obtain a backtrace.
>
> $ gdb --args python
> ...
> (gdb) run
> ...
> (gdb) bt
> ...
>
>    
Thanks for that!
It also made remember that numpy is being built with Atlas 3.8.3.

$ gdb --args python
GNU gdb (GDB) Fedora (6.8.50.20090302-39.fc11)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) run
Starting program: /usr/local/bin/python
[Thread debugging using libthread_db enabled]
Python 2.7a1 (r27a1:76674, Dec 14 2009, 13:46:01)
[GCC 4.4.1 20090725 (Red Hat 4.4.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy as np
 >>> from numpy.compat import asbytes, getexception
 >>> np.fromstring(asbytes('1 , 2 , 3 , 4'),sep=',')

Program received signal SIGSEGV, Segmentation fault.
setup_context (registry=<value optimized out>, module=<value optimized 
out>, lineno=<value optimized out>, filename=<value optimized out>, 
stack_level=<value optimized out>)
     at Python/_warnings.c:449
449         PyFrameObject *f = PyThreadState_GET()->frame;
(gdb) bt
#0  setup_context (registry=<value optimized out>, module=<value 
optimized out>, lineno=<value optimized out>, filename=<value optimized 
out>, stack_level=<value optimized out>)
     at Python/_warnings.c:449
#1  do_warn (registry=<value optimized out>, module=<value optimized 
out>, lineno=<value optimized out>, filename=<value optimized out>, 
stack_level=<value optimized out>)
     at Python/_warnings.c:593
#2  0x0000000000493c81 in PyErr_WarnEx (category=0x760720, text=<value 
optimized out>, stack_level=1) at Python/_warnings.c:719
#3  0x00000000004c8e94 in PyOS_ascii_strtod (nptr=0x7ffff7f08914 "1 , 2 
, 3 , 4", endptr=0x7fffffffdb28) at Python/pystrtod.c:282
#4  0x00007ffff2954151 in NumPyOS_ascii_strtod (s=0x7ffff7f08914 "1 , 2 
, 3 , 4", endptr=0x7fffffffdb28) at numpy/core/src/multiarray/numpyos.c:527
#5  0x00007ffff29541cc in DOUBLE_fromstr (str=0x7ffff7ef14b0 "\1", 
ip=0xac4d60, endptr=0x0, __NPY_UNUSED_TAGGEDignore=0x6920656c62756f64)
     at numpy/core/src/multiarray/arraytypes.c.src:1575
#6  0x00007ffff29375a7 in fromstr_next_element (s=0x7fffffffdb28, 
dptr=0x760720, dtype=<value optimized out>, end=0x7ffff7f08921 "") at 
numpy/core/src/multiarray/ctors.c:35
#7  0x00007ffff296153a in array_from_text (dtype=0x7ffff2bbd440, 
num=<value optimized out>, sep=<value optimized out>, 
nread=0x7fffffffdbb8, stream=0x7ffff7f08914,
     next=<value optimized out>, skip_sep=0x7ffff294cb70 
<fromstr_skip_separator>, stream_data=0x7ffff7f08921) at 
numpy/core/src/multiarray/ctors.c:2950
#8  0x00007ffff2961751 in PyArray_FromString (data=0x7ffff7f08914 "1 , 2 
, 3 , 4", slen=<value optimized out>, dtype=0x7ffff2bbd440, num=-1, sep=0x0)
     at numpy/core/src/multiarray/ctors.c:3264
#9  0x00007ffff29618cf in array_fromstring 
(__NPY_UNUSED_TAGGEDignored=<value optimized out>, args=<value optimized 
out>, keywds=<value optimized out>)
     at numpy/core/src/multiarray/multiarraymodule.c:1707
#10 0x00000000004a03c0 in do_call (nk=<value optimized out>, na=-1, 
pp_stack=<value optimized out>, func=<value optimized out>) at 
Python/ceval.c:4194
#11 call_function (nk=<value optimized out>, na=-1, pp_stack=<value 
optimized out>, func=<value optimized out>) at Python/ceval.c:4002
#12 PyEval_EvalFrameEx (nk=<value optimized out>, na=-1, pp_stack=<value 
optimized out>, func=<value optimized out>) at Python/ceval.c:2618
#13 0x00000000004a12a6 in PyEval_EvalCodeEx (co=0x7ffff7ef6210, 
globals=<value optimized out>, locals=<value optimized out>, args=0x0, 
argcount=1702130542,
     kws=<value optimized out>, kwcount=0, defs=0x0, defcount=0, 
closure=0x0) at Python/ceval.c:3209
#14 0x00000000004a1372 in PyEval_EvalCode (co=0x7ffff7ef14b0, 
globals=0x760720, locals=0x0) at Python/ceval.c:666
#15 0x00000000004c0047 in run_mod (arena=<value optimized out>, 
flags=<value optimized out>, locals=<value optimized out>, 
globals=<value optimized out>,
     filename=<value optimized out>, mod=<value optimized out>) at 
Python/pythonrun.c:1342
#16 PyRun_InteractiveOneFlags (arena=<value optimized out>, flags=<value 
optimized out>, locals=<value optimized out>, globals=<value optimized out>,
     filename=<value optimized out>, mod=<value optimized out>) at 
Python/pythonrun.c:847
#17 0x00000000004c024e in PyRun_InteractiveLoopFlags (fp=0x34ecf686a0, 
filename=0x5161a8 "<stdin>", flags=0x7fffffffdff0) at Python/pythonrun.c:767
#18 0x00000000004c094b in PyRun_AnyFileExFlags (fp=0x34ecf686a0, 
filename=0x5161a8 "<stdin>", closeit=0, flags=0x7fffffffdff0) at 
Python/pythonrun.c:736
#19 0x0000000000414334 in Py_Main (argc=0, argv=<value optimized out>) 
at Modules/main.c:576
#20 0x00000034ecc1ea2d in __libc_start_main (main=<value optimized out>, 
argc=<value optimized out>, ubp_av=<value optimized out>, init=<value 
optimized out>,
     fini=<value optimized out>, rtld_fini=<value optimized out>, 
stack_end=0x7fffffffe108) at libc-start.c:220
#21 0x0000000000413619 in _start ()



Bruce


More information about the NumPy-Discussion mailing list