Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can cause "corrupted double-linked list" error?

Tags:

c++

memory

free

I am having problems with a fairly complex code. I wasn't able to produce a short snippet that reproduces the error, so I'll try to explain the problem in words.

The code crashes randomly with the error

*** glibc detected *** gravtree: corrupted double-linked list: 0x000000001aa0fc50 ***

Debugging showed that it comes from the line where the codes frees an object. There seems to be nothing wrong with the object. It exists, and I can access it's data at the time the error occurs. The object's destructor is trivial and doesn't do anything.

So, I'm kind of stuck. In what kind of circumstances do you expect 'free' to fail?

like image 279
hanno Avatar asked Nov 30 '09 13:11

hanno


1 Answers

Try running your program under Valgrind. It may point you to an earlier cause, whereas gdb is only breaking in where damage has already occurred.

like image 142
Warren Young Avatar answered Nov 11 '22 21:11

Warren Young