0

I'm recoding malloc/calloc/realloc/free functions. For now, I finished malloc and for tests, I just write "free" function like :

void free(void* ptr) {}

And I test my functions with different software, works with ls/firefox/man ...

But, with software like GIMP I have :

*** Error in `gimp': free(): invalid next size (normal): 0x0000000001d75e00 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x80996)[0x7f280d77e996]
/lib/x86_64-linux-gnu/libc.so.6(+0x82614)[0x7f280d780614]
/lib/x86_64-linux-gnu/libc.so.6(__libc_memalign+0x9a)[0x7f280d781e1a]
/lib/x86_64-linux-gnu/libc.so.6(posix_memalign+0x4c)[0x7f280d783a2c]

SO, I don't understand why I've this problem with a free which do nothing. (my free function is called, I tested with a "printf")

Does someone know where it comes from?

Thanks for reading Hope to hear you

Titouan56
  • 6,932
  • 11
  • 37
  • 61
  • in which context you use the free ? a bit more code of where it fits in willl nice. – KARTHIK BHAT Feb 14 '14 at 09:37
  • I didn't use the free, it's why this error looks weird. In this message the error comes from posix_memalign, I recode it like : int posix_memalign(void **memptr, size_t alignment, size_t size) { } And the error has changed, now it's : ***MEMORY-ERROR***: [10180]: GSlice: failed to allocate 1008 bytes (alignment: 1024): Key has been revoked – Titouan56 Feb 14 '14 at 09:39
  • It seems like the original system free got called from somewhere, perhaps from inside a library. – Thomas Padron-McCarthy Feb 14 '14 at 09:46
  • The problem occured only when the software is built with GTK (like gimp/ chromium), is it possible that GTK call free? – Titouan56 Feb 14 '14 at 09:49

0 Answers0