0

I'm getting the following error when debugging a C extension in gdb

Program received signal SIGSEGV, Segmentation fault.
PyType_IsSubtype (a=0xc0089ca71d1afbb6, b=0x7fffed5441e0) at Objects/typeobject.c:1150
1150    Objects/typeobject.c: No such file or directory.
        in Objects/typeobject.c

All I've found about it, so far, was a bug report regarding Python 3.4 in Debian 6.

Using: Python 2.7.6/CentOS 6.6

irios
  • 165
  • 1
  • 11

1 Answers1

1

I got it solved. On my C extension code I was creating some objects:

PyArrayObject *py_u2r, *py_u2l, *py_u2s;

py_u2r= (PyArrayObject *) PyArray_FromDims(2,dims,NPY_CDOUBLE);
py_u2l= (PyArrayObject *) PyArray_FromDims(2,dims,NPY_CDOUBLE);
py_u2s= (PyArrayObject *) PyArray_FromDims(2,dims,NPY_CDOUBLE);

Only problem was that I wasn't returning them properly. So, I just added following return line and it is working now:

return Py_BuildValue("OOO", py_u2r, py_u2l, py_u2s);

In this link I figured out about Py_BuildValue syntax, which is pretty straightforward.

irios
  • 165
  • 1
  • 11