The current implementation doesn't handle posix_memalign().
Programs using posix_memalign() to allocate memory effectively silently fall back to the standard implementation. Whenever the program calls free() to release the memory, the efence implementation is called and barfs that the memory is unknown, leading to a core dump.
Sadly, many programs use posix_memalign and thus cannot be debugged with efence.
Created attachment 201507 [details]
Found this patch in the net and it works. Not sure about the author.
Can you provide the link (source) of the patch ?
I checked the attachment, patch is not complete (lines are missing), can you re-upload ?
Can you also provide a testcase, name a program that can not be debugged
with efence ?
I found the patch at Redhat Bug 603075, see https://bugzilla.redhat.com/show_bug.cgi?id=603075
But according to the timestamp, the patch is much older. I found an older version at https://launchpad.net/ubuntu/+source/electric-fence/+changelog but I couldn't trace the referenced bug, but according to change log it seems that the patch was contributed by Petr Machata.
Created attachment 201907 [details]
patch to add posix_memalign()
Ups - patch should be complete now.
E.g. nginx uses posix_memalign() for its memory pool. With the patch, I could solve bug #235296.