[SciPy-dev] PyArray_New problem
Robert Cimrman
cimrman3 at ntc.zcu.cz
Fri Dec 2 04:23:23 EST 2005
Could someone tell me what I am doing wrong? I would like to use a
function like the snippet below to create an array.
PyArrayObject *helper_newCArrayObject_i32( int32 len, int32 *array ) {
intp plen[1];
PyArrayObject *obj = 0;
plen[0] = len;
printf( "11111 %d\n", PyArray_INT32 );
/* obj = (PyArrayObject *) PyArray_SimpleNew( 1, plen, PyArray_INT32 ); */
obj = (PyArrayObject *) PyArray_New( &PyArray_Type, 1, plen,
PyArray_INT32, NULL, NULL, 0, CARRAY_FLAGS, NULL );
....
}
but I get this segfault on the line 'obj = ...'.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 19363)]
0xb7a91e50 in PyArray_DescrFromType (type=-1213462880) at
arraytypes.inc:11645
11645 return descrs[type];
(gdb) bt
#0 0xb7a91e50 in PyArray_DescrFromType (type=-1213462880)
at arraytypes.inc:11645
#1 0xb7aa1ee3 in PyArray_ValidType (type=-1213462880) at arrayobject.c:5050
#2 0xb65a38c0 in helper_newCArrayObject_i32 (len=271, array=0x82ed318)
at graph_wrap.c:790
#3 0xb65a65df in _wrap_mesh_rawGraph (self=0x0, args=0xb66053bc)
at graph_wrap.c:1980
#4 0xb7e7d1ff in PyCFunction_Call (func=0xb65e258c, arg=0xb66053bc, kw=0x0)
at methodobject.c:73
#5 0xb7ebf857 in call_function (pp_stack=0xbf9769d8, oparg=5) at
ceval.c:3558
...
In [2]:nm.__scipy_version__
Out[2]:'0.4.3.1471'
In [3]:nm.__core_version__
Out[3]:'0.7.4.1550'
r.
More information about the SciPy-Dev
mailing list