[SciPy-dev] segfault during scipy.test(1) - Solaris 8, Sun compilers
pearu at cens.ioc.ee
Tue Oct 8 16:49:14 CDT 2002
On Tue, 8 Oct 2002, Skip Montanaro wrote:
> Python is crashing on me during scipy.test(1) (Solaris 8, Sun compilers).
> The start of the traceback in dbx looks like:
>  copy_ND_array(in = 0x7771d8, out = 0x777a70), line 780 in "fortranobject.c"
>  array_from_pyobj(type_num = 9, dims = 0xffbeaa3c, rank = 2, intent = 97, obj = 0x7771d8), line 556 in "fortranobject.c"
>  f2py_rout__flinalg_ddet_r(capi_self = 0x402858, capi_args = 0x85dcf8, capi_keywds = 0x85c790, f2py_func = 0xfd6bf320 = &ddet_r_()), line 298 in "_flinalgmodule.c"
>  fortran_call(fp = 0x402858, arg = 0x85dcf8, kw = 0x85c790), line 248 in "fortranobject.c"
>  PyObject_Call(func = 0x402858, arg = 0x85dcf8, kw = 0x85c790), line 1684 in "abstract.c"
>  do_call(func = 0x402858, pp_stack = 0xffbeaf40, na = 1, nk = 1), line 3262 in "ceval.c"
>  eval_frame(f = 0x386568), line 2028 in "ceval.c"
>  PyEval_EvalCodeEx(co = 0x7cbcc8, globals = 0x7cf358, locals = (nil), args = 0x3093b4, argcount = 1, kws = 0x3093b8, kwcount = 0, defs = 0x7cccbc, defcount = 1, closure = (nil)), line 2585 in "ceval.c"
>  fast_function(func = 0x7d9c50, pp_stack = 0xffbeb4a0, n = 1, na = 1, nk = 0), line 3164 in "ceval.c"
> Line 780 of F2PY's fortranobject.c is
> PyArray_VectorUnaryFunc *cast = in->descr->cast[out->descr->type_num];
> The value in out->descr->type_num (and in->descr->type_num for that matter)
> is -18789104, which is clearly out of range for an element of PyArray_TYPES.
> (Why doesn't Numeric define it as such in its PyArray_Descr struct?)
What do you mean? type_num is defined in PyArray_Descr struct as an int.
Hmm, looking the definition of PyArray_TYPES and the way how the length of
PyArray_Descr.cast array is determined, makes me wonder... but it should
be correct because people use Numeric on Sun, I suppose.
> Does this seem familiar to anyone?
No. But I am wondering if other `in' and `out' attributes make sense? To
find out, uncomment lines starting at #782 and also dump_attrs() function
definition starting at line #455 in fortranobject.c. You may also need to
initialize `cast' after the line #788. What is the output? Is it
I ask this in order to see if there is some memory corruption going
on or if just descr->type_num is not initialized correctly for some
PS: I assume that f2py tests were all ok on your platform. Is that
More information about the Scipy-dev