[LLVMdev] Accounting for stack space
Gordon Henriksen
gordonhenriksen at mac.com
Tue Jul 10 13:29:04 PDT 2007
On Jul 10, 2007, at 15:39, Chris Lattner wrote:
> On Tue, 10 Jul 2007, Sandro Magi wrote:
>
>>> used. Your choices are to either override malloc/free for both
>>> the JIT and the program or for neither of them.
>>
>> I want to 'intercept' ALL allocations actually, including the
>> stack if possible, so the above suits me just fine.
>
> Ok, just provide your own malloc/free. :)
One of the existing malloc replacements should provide hints for how
to go about that. www.hoard.org for one. The details on Windows are
especially complicated.
Be aware that even doing this won't reliably intercept all
allocations. With Mac OS X, Mach's vm_allocate call is accessible.
With Unix, mmap with flags = MAP_ANON allocates memory. And even
still, the implementations of these aren't magic; it's possible to
make the syscalls without linking to these symbols per se. There are
likely further facilities to distrust on any given platform, as well.
If you're intending to sandbox untrusted third-party code, then you
need to consider these issues.
Good luck,
Gordon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070710/ba47a0ae/attachment.html>
More information about the llvm-dev
mailing list