c - corrupted unsorted chunks while calling free() -


*** glibc detected *** ./a.out: free(): corrupted unsorted chunks: 0x00000000007646b0 *** *** glibc detected *** ./a.out: malloc(): memory corruption: 0x00000000007635a0 *** 

i'm getting above error. i'm sure i'm not using memory after freeing. why above error ?

all heaps, store kinds of meta-data inside itself. when malloc or free, heap perform book-keeping functions on heap. if detects totally unexpected in meta-data, crash.

normal heap operations highly unlikely cause such problems, program cause. since program has access memory in process including heap meta-data, program have accidentally overwritten of meta-data.

a cause writing beyond end of allocated buffer. write allowed , extremely corrupt heap meta-data. when detected heap, program abort.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -