Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Another attempt at PRELOADing mmalloc (WIP)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 22 Jul 2022 21:24:27 +0000 (23:24 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 22 Jul 2022 21:31:49 +0000 (23:31 +0200)
commit8a3175c8d73996d77d1d06f85941bc60f5a9cf17
treec5126d83e5d7aac9400bb528563c4f30ab472564
parentca4b2530adfd8eed9d88635dd30e9449e90b3b53
Another attempt at PRELOADing mmalloc (WIP)

Try to have mmalloc both in the simgrid library (for the regular use)
and also as an external library that can be LD_PRELOADed before
sthread too.

We'll have two copies of the library when actually preloading it in
sthread, but in this case, we use dlsym(RTDL_NEXT) to find the first
loaded symbol in memory to have only one mheap in the process.

It still segfault when launching a sthread code within simgrid-mc as
follows:
   bin/simgrid-mc --cfg=model-check/setenv:LD_PRELOAD=lib/libsgmalloc.so:lib/libsthread.soexamples/sthread/pthread-mutex-simple
but at least it should fix the breakage found on FreeBSD.
src/mc/api.cpp
src/xbt/mmalloc/mm_interface.c
src/xbt/mmalloc/mm_module.c
tools/cmake/DefinePackages.cmake