Ask Your Question

Glibc detected

asked 2013-06-30 19:36:11 -0500

residentelvio gravatar image

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: =========

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< vector<double> >X(cols, vector<double>(rows));
   vector< vector<double> >Y(cols, vector<double>(rows));
   double epsilon = 0.0001;


   for(int i=0;i<cols;i++){

   for(int z=0;z<rows;z++){

   for(int m=0;m<cols;m++){
      for(int n=0;n<rows;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]);



    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;
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-07-02 18:18:24 -0500

CodeFinder gravatar image

I cannot see any problems in your code. The issue have to be related to calling free/delete on a pointer more than once (as the error message states).

You should use a debugger (with the -g flag) to step through your code. When the glibc detects your invalid free call, the debugger halts and you can inspect the backtrace. Hopefully, the backtrace gives you more information about your problem.

However, this problem does not seem to be OpenCV-related.

HTH ;-)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-06-30 19:36:11 -0500

Seen: 485 times

Last updated: Jul 02 '13