When I run the simulation with "smaller" arrays it works, and I get the results that I expect from it. The segfaults comes out when I raise the dimensions of the variables. That's why I don't think that there's a bug.
I have more than 1000 lines of code and several files, that's why I didn't post it. Here's the declaration of the arrays
int main(){
Code:
double U[Nsiti][Ndim][N][N][2]={};
double Tarray0[Lato/d0][Lato*Lato][2][Rmax-Rmin][N*N][N*N][2]={};
double PP[Lato*Lato][2][Rmax-Rmin]={};
Here's a typical dimension setting
double U [13824] [3] [3] [3] [2]={};
double Tarray0[12] [576] [2] [1] [9] [9] [2]={};
double PP[576] [2] [1]={};
And then I have some others array which are created locally in some subroutines...
I work on unix, here's what I get on my laptop with "top" on shell, when I say 0.5 Gb I refer to Mem.
Mem: 3106372k total, 716412k used, 2389960k free, 18072k buffers
Swap: 2080376k total, 0k used, 2080376k free, 305072k cached