[Numpy-discussion] crashes after switching to 1.3.x
Todd Miller
jmiller at stsci.edu
Fri May 27 03:54:30 EDT 2005
Hi Adrian,
On Thu, 2005-05-26 at 18:00 -0700, Adrian E. Feiguin wrote:
> Hi! I'm the lead developer of scigraphica (SG)
> http://scigraphica.sourceforge.net and I'm using python and numarray to
> parse math. SG is built on top of libscigraphica, and libscigraphica has
> all the python code. I've been using an old version 0.6.1, and
> everything worked fine. After switching to 1.6.2the program crashes.
> I'll give you some info to see if you can tell me what's wrong:
>
> I'm using:
> #define PY_ARRAY_UNIQUE_SYMBOL PyArrayXXX
> #include <arrayobject.h>
>
> and in the code:
> import_libnumeric();
> import_array();
>
> object=PyRun_String ("from numarray import *", Py_single_input,
> main_dict, sg_dict);
>
> (I noticed that you have to add import_libnumeric now)
In general, this is not true.
Paradoxically, if you're using the numeric compatible API,
import_array() is all you need to do. If you're using both the numarray
native and numeric compatible APIs, then you need to
import_libnumarray() and import_libnumeric().
> The gdb output is:
>
> Importing python module: sys
> Importing python module: pickle
> Importing python module: os
> Importing python module: numarrayProgram received signal SIGSEGV,
> Segmentation fault.
> [Switching to Thread 1083181376 (LWP 11648)]
> 0x400ab0b5 in PyObject_GetAttrString ()
> from
> /home/afeiguin/cvs/test/libscigraphica-2/scigraphica/.libs/libscigraphica-2.0-2.0.so.0
> #0 0x400ab0b5 in PyObject_GetAttrString ()
> from
> /home/afeiguin/cvs/test/libscigraphica-2/scigraphica/.libs/libscigraphica-2.0-2.0.so.0
> #1 0x40b1ff66 in deferred_libnumarray_init () at
> Src/libnumarraymodule.c:152
> #2 0x40b21f8c in NA_NumArrayCheck (op=0x0) at Src/libnumarraymodule.c:1357
> #3 0x40b43c1c in PyArray_Check (op=0x0) at Src/libnumericmodule.c:216
> #4 0x4004d903 in python_insert_object (worksheet=0x81ba4e0, row=0, col=0,
> object=0x80bda3c, orient=GTK_ORIENTATION_VERTICAL, link=0, as_is=0)
> at sg_python_worksheet.c:802
> #5 0x4004da12 in python_sheet (worksheet=0x81ba4e0, row=0, col=0,
> command=0x8366d68 ".1", orient=GTK_ORIENTATION_VERTICAL)
> at sg_python_worksheet.c:843
> #6 0x40061f7c in sg_worksheet_cell_set (worksheet=0x81ba4e0, row=0, col=0,
> text=0x8365520 ".1", formula=1, eval=1) at sg_worksheet.c:508
> #7 0x40061d59 in set_cell (sheet=0x81ba4e0, row=0, col=0, data=0x81ba4e0)
> at sg_worksheet.c:439
>
> Look that in #4 object=0x80bda3c, and in #3 op=0x0.
> Any hints?
numarray-0.6.1 is very old so in order to transition to numarray-1.3.2
you should:
a. completely delete your numarray installation
b. reinstall numarray
c. rebuild and reinstall any extensions based on numarray.
My guess is that either you have overlapping/conflicting numarray
installations or you have extensions from numarray-0.6.1 trying to run
against numarray-1.3.2.
Regards,
Todd
More information about the NumPy-Discussion
mailing list