On Thu, Aug 1, 2013 at 9:28 PM, Stefan Seefeld
<[email protected]> wrote:
> I don't think any of this works. The ultimate problem is the one Jérémie
> reported initially: dlsym will eventually call free() on the memory
> calloc() returned, so my calloc fallback needs to return something that
> can actually be freed.

I pointed out how free() will be safe specifically:

>> dlsym stores pointer to calloc'ed buffer, overwriting the pointer to mmap'ed
>> buffer, completing initialization for the second time and making the
>> subsequent free() safe.

Besides, you're intercepting free() in your LD_PRELOAD module as well,
so you can just catch attempts to free your mmap'ed buffers there and
munmap them safely.

Alexander

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to