thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

numpy.load segfaults (Trac #1808) #5606

Open numpy-gitbot opened 12 years ago

numpy-gitbot commented 12 years ago

Original ticket http://projects.scipy.org/numpy/ticket/1808 on 2011-04-26 by atmention:jpaalasm, assigned to unknown.

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: ==

jpaalasmatmention: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.

numpy-gitbot commented 12 years ago

atmention:jpaalasm wrote on 2011-04-26

The offending file can be downloaded from http://dl.dropbox.com/u/1518846/seqfaulting_sleep_stage_data.npy