Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fight for better integration of mmalloc, mc and xbt
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 6 May 2010 23:43:13 +0000 (23:43 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 6 May 2010 23:43:13 +0000 (23:43 +0000)
commit4c04d8355923f8323a1a3195fe3b73ac08b984ea
tree65c921eebb0d25ce5306476b41726f5bf5e599cd
parentf2d062a16daf5602b56944a78c51c36ae317a7fa
Fight for better integration of mmalloc, mc and xbt

I wanted to move the legacy interception (ie, redefinition of
malloc/free/realloc) from mc to mmalloc, where it should be.

But it broke libgras, with memory curruption symptoms in tesh. I
thought that it was a race condition because mmalloc is not reentrent.

So, I protected the main functions with a xbt_os_mutex (and creating
it in the default heap was challenging since the mutex itself must be
in the heap, which is not ready yet).

But it didn't help: I still had the memory corruption symptoms in
tesh, inchanged. Maybe some system function get fucked up by the
mmalloc stuff?

So I decided to comment out the legacy interception from mmalloc for a
while (breaking mc, but who cares at this point?).

But the xbt_os_mutexes are not in libsimgrid since pthreads and
ucontextes didn't intermix well a few years ago. So, I changed the
corresponding stubs from "die loudly" to "do nothing". That's
dangerous (one could think he's protected by mutex when not), but I
need the EPR refactoring to sort it out correctly.

All this for... nothing. The legacy interception will still be in mc.
And I guess that mc must be in another library, not the simulation
one, if it does not intermix well with syscalls.

Well mmalloc is now a bit more thread-friendly, let's be positive.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7711 48e7efb5-ca39-0410-a469-dd3cf9ba447f
19 files changed:
include/xbt/mmalloc.h
src/include/mc/mc.h
src/mc/mc_memory.c
src/mc/private.h
src/xbt/mmalloc/attach.c
src/xbt/mmalloc/detach.c
src/xbt/mmalloc/keys.c
src/xbt/mmalloc/mcalloc.c
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm.c
src/xbt/mmalloc/mm_legacy.c [new file with mode: 0644]
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmemalign.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/mmalloc/sbrk-sup.c
src/xbt/xbt_sg_stubs.c
src/xbt_modinter.h
tools/tesh/run_context.c