[Numpy-discussion] crashes after switching to 1.3.x

Todd Miller jmiller at stsci.edu
Sun May 29 04:59:18 EDT 2005


Hi Adrian,

I don't think you should be doing both "import_array()" and
"import_libnumeric()".  Those should be roughly equivalent.  If you're
using only the Numeric compatible API (no NA_ functions) then do:

#include "numarray/arrayobject.h"

... and later in your init function:

import_array();

just like Numeric.  If you also need some of the NA_ functions,  then
look at Src/_dotblas.c or Src/_numarraymodule.c for how to interface
with both native and numeric compatible interfaces at the same time.  If
you only need NA_ functions, look at Src/_ndarraymodule.c.

Regards,
Todd

On Fri, 2005-05-27 at 18:37 -0700, Adrian E. Feiguin wrote:
> Hi Todd,
> 
> Thank you for your reply. I have a completely new installation, there 
> are no conflicts with previous installations.
> I found that the problem is in import_libnumeric in libnumeric.h. It 
> seems that the libnumeric_API is not initialized because it doesn't pass 
> the line:
> 
>         PyObject *module = 
> PyImport_ImportModule("numarray.libnumeric");     \
>         if (module != NULL) 
> {                                               \
> 
> Any ideas?
> Thank you again,
> <ADRIAN>
> 
> 
> Todd Miller wrote:       
> 
> >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
> >
> >
> >.
> >
> >  
> >
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion





More information about the NumPy-Discussion mailing list