[NumPy-Tickets] [NumPy] #1808: numpy.load segfaults

NumPy Trac numpy-tickets@scipy....
Tue Apr 26 04:42:24 CDT 2011


#1808: numpy.load segfaults
----------------------------------+-----------------------------------------
 Reporter:  jpaalasm              |       Owner:  somebody   
     Type:  defect                |      Status:  new        
 Priority:  normal                |   Milestone:  Unscheduled
Component:  numpy.core            |     Version:  1.5.1      
 Keywords:  segfault, numpy.load  |  
----------------------------------+-----------------------------------------
 An array with dtype

 {{{
 numpy.dtype([("time", object), ("value", "|S1")])
 }}}

 was saved to a file with numpy.save on a 32-bit Ubuntu.

 The loading of the file using numpy.load crashes on 64-bit Ubuntu, but
 succeeds with 32-bit Ubuntu. Numpy version is 1.5.1.

 == 64-bit Ubuntu 10.04: ==

 {{{
 jpaalasm@ubuntu:~$ gdb --args python -c "import numpy;
 numpy.load(file('seqfaulting_sleep_stage_data.npy'))"
 GNU gdb (GDB) 7.1-ubuntu
 Copyright (C) 2010 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-linux-gnu".
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>...
 Reading symbols from /usr/bin/python...Reading symbols from
 /usr/lib/debug/usr/bin/python2.6...done.
 done.
 (gdb) c
 The program is not being run.
 (gdb) run
 Starting program: /usr/bin/python -c import\ numpy\;\
 numpy.load\(file\(\'seqfaulting_sleep_stage_data.npy\'\)\)
 [Thread debugging using libthread_db enabled]

 Program received signal SIGSEGV, Segmentation fault.
 0x00007ffff6755778 in PyArray_Item_XDECREF (data=0xe3f960 "xޮ",
 descr=0x7ffff3bdc198) at numpy/core/src/arrayobject.c:205
 205     numpy/core/src/arrayobject.c: No such file or directory.
         in numpy/core/src/arrayobject.c
 (gdb) bt
 #0  0x00007ffff6755778 in PyArray_Item_XDECREF (data=0xe3f960 "xޮ",
 descr=0x7ffff3bdc198) at numpy/core/src/arrayobject.c:205
 #1  0x00007ffff6755749 in PyArray_Item_XDECREF (data=0xe3f960 "xޮ",
 descr=0x7ffff3bdc4f8) at numpy/core/src/arrayobject.c:221
 #2  0x00007ffff675ddcb in PyArray_XDECREF (mp=0xb29040) at
 numpy/core/src/arrayobject.c:308
 #3  0x00007ffff67719bc in array_dealloc (self=0xb29040) at
 numpy/core/src/arrayobject.c:2127
 #4  0x00000000004a3631 in PyEval_EvalFrameEx (f=Frame 0x91c180, for file
 <string>, line 1, in <module> (), throwflag=<value optimized out>) at
 ../Python/ceval.c:1010
 #5  0x00000000004a9671 in PyEval_EvalCodeEx (co=0x7ffff7ef6af8,
 globals=<value optimized out>, locals=<value optimized out>, args=0x0,
 argcount=<value optimized out>, kws=<value optimized out>, kwcount=0,
     defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:3000
 #6  0x00000000004a9742 in PyEval_EvalCode (co=0xe3f960,
 globals=<numpy.dtype at remote 0x7ffff3bdc198>, locals=0x0) at
 ../Python/ceval.c:541
 #7  0x00000000004caae7 in run_mod (command=<value optimized out>,
 flags=<value optimized out>) at ../Python/pythonrun.c:1339
 #8  PyRun_StringFlags (command=<value optimized out>, flags=<value
 optimized out>) at ../Python/pythonrun.c:1302
 #9  PyRun_SimpleStringFlags (command=<value optimized out>, flags=<value
 optimized out>) at ../Python/pythonrun.c:961
 #10 0x000000000041a268 in Py_Main (argc=1, argv=<value optimized out>) at
 ../Modules/main.c:521
 #11 0x00007ffff69d8c4d in __libc_start_main () from /lib/libc.so.6
 #12 0x00000000004199f9 in _start ()
 }}}

 == 32-bit Ubuntu 10.04: ==

 {{{
 In [5]: numpy.load(file("seqfaulting_sleep_stage_data.npy"))
 Out[5]:
 array([(0.0, 'A'), (2.0, 'A'), (4.0, 'A'), ..., (64794.0, 'L'),
        (64796.0, 'L'), (64798.0, 'L')],
       dtype=[('time', '|O4'), ('value', '|S1')])
 }}}

 The offending file is attached.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1808>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list