Glibc detected
Hi people I have this error entering a function: (really the error lines are more than this I put)
*** glibc detected *** /home/elvio/workspace/aws/Debug/aws: double free or corruption (!prev): 0x0000000001eff100 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f950c739b96]
/home/elvio/workspace/aws/Debug/aws[0x40afde]
/home/elvio/workspace/aws/Debug/aws[0x40a940]
/home/elvio/workspace/aws/Debug/aws[0x409f3b]
/home/elvio/workspace/aws/Debug/aws(_ZNSt6vectorId
The function is : (I print Welcome to see in console I enter in the function)
void pre_filter_Computations(vector< vector<double> > radius,vector< vector<double> > theta,int cols,int rows){
vector<double>x(cols);
vector<double>y(rows);
vector< vector<double> >X(cols, vector<double>(rows));
vector< vector<double> >Y(cols, vector<double>(rows));
double epsilon = 0.0001;
printf("welcome\n");
for(int i=0;i<cols;i++){
x[i]=((double)(i-cols)/2)/((double)cols/2);
}
for(int z=0;z<rows;z++){
y[z]=-(((double)(z-rows)/2)/((double)rows/2));
}
for(int m=0;m<cols;m++){
for(int n=0;n<rows;n++){
X[m][n]=x[m];
Y[m][n]=y[n];
}
}
for(int a=0;a<rows;a++){
for(int b=0;b<cols;b++){
X[a][b] = pow(X[a][b],2);
Y[a][b] = pow(Y[a][b],2);
X[a][b] = X[a][b] + Y[a][b];
radius[a][b] = sqrt(X[a][b]);
}
}
radius[rows/2][cols/2]=1;
for(int a=0;a<rows;a++){
for(int b=0;b<cols;b++){
radius [a][b]= radius[a][b] + epsilon;
theta[a][b] = atan2(Y[a][b],X[a][b])*180/PI;
}
}