[SciPy-User] f2py segfault

Juan fiolj@yahoo....
Sun Jan 17 12:28:23 CST 2010

Hi, I don't know if this is the right place (if it is not, please point me in
the right direction).
I am using f2py with some own programs and I am going insane with a segmentation
fault. It is probably a problem in my code but I'd like to know if someone has
any hint
to give me since I've been trying different things for two days already.

I've got a few routines in fortran with in/out arrays. When I call one of the
routines it works well. The second routine I call crashes the program. I've been
changing routines and it seems that it does not matter with routines I use.

Basically, the fortran routines have the signature:

subroutine sub1(y, Np, Nt)
  integer(4), intent(IN) :: Np
  integer(4), intent(IN) :: Nt
  real(8), intent(INOUT), dimension(6*Np, Nt) :: y

and I call them from python as:

import mymod
r= np.zeros((Ncoord,Ntraj),dtype=np.float64, order='Fortran')

I am using python 2.6. Probably the statement of the problem is to vague to get
an answer. But I'll settle for just some ideas on how to proceed. I've used the
option for debugging: --debug-capi
but it does not provide with more information. Only tells me that it checks for
the array and segfaults (before analyzing the integer arguments Np, Nt)

Thanks, Juan

More information about the SciPy-User mailing list