|
From: Xiaopi <liu...@gm...> - 2013-07-16 12:03:33
|
Thank you for the reply. Looks like there is API for this, after google with your suggestion. But I still don't quite understand. Are u meaning that if we write more bytes than the malloc usable size, it is corrupted for the ptr? Thanks, 2013-7-16,18:32,vijay nag <vi...@gm...> > On Tue, Jul 16, 2013 at 3:53 PM, Xiaopi Liu <liu...@gm...> wrote: >> Dear all, >> >> >> I have see this error/crash in an existing large code base. >> Just cannot identify the exact crash point, even using valgrind. >> Can someone help point out what exactly this crash/error means? >> >> Does it necessarily related to malloc/free operation? >> By this I mean, if only new/delete op is used, will I still see the same >> error? >> Any general background on the possible cause for this? >> >> >> *** glibc detected *** .: free(): invalid next size (fast) >> >> -- >> >> >> Best wishes! >> Sincerely yours, LIU >> >> ------------------------------------------------------------------------------ >> See everything from the browser to the database with AppDynamics >> Get end-to-end visibility with application monitoring from AppDynamics >> Isolate bottlenecks and diagnose root cause in seconds. >> Start your free trial of AppDynamics Pro today! >> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk >> _______________________________________________ >> Valgrind-users mailing list >> Val...@li... >> https://lists.sourceforge.net/lists/listinfo/valgrind-users > It could either be corruption or double free error. Mostly the > malloc_usable_size is corrupted here. > You can get the malloc_usable_size the following way. > > malloc_usable_size(ptr) > { > char * p = (char*)ptr; > size = *(p -4); > if (size & 2) { > blockSize = (size & ~3) - 2*4; > } else { > blockSize = (size & ~3) -4; > } > } |