<br><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 11:51 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
AFAIK, MacOSX does something like this already. </blockquote><div><br></div><div>Yes, and that is very unfortunate. </div><div>Intercepting allocators on mac is much more complicated than on linux. </div><div>For Linux, including android, I believe we can do simpler. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">We could speed up<br>
__asan_mz_size significantly and make it lock-free.<br></blockquote><div><br></div><div>Mmm. That'll be non-trivial at least. Especially on 32-bit where we have scarce address space. </div><div>(On 64-bit this can be done by maping a 128G virtual memory chunk and then allocating only from it). </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I don't see a way to call __asan_init much earlier, other than<br>
patching the linker or something like that.<br></blockquote><div><br></div><div>Why not. having __asan_init be called before everything else is really important. </div><div><br></div><div>--kcc </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="HOEnZb"><div class="h5"><br>
On Thu, Dec 8, 2011 at 11:02 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
> Having such patch, even under ifdef ANDROID, will be very sad.<br>
> It makes free() much slower (linear time + lock, instead of constant time<br>
> w/o lock).<br>
> We need to figure out some other way (e.g. try to run __asan_init() even<br>
> earlier).<br>
><br>
> --kcc<br>
><br>
><br>
> On Thu, Dec 8, 2011 at 6:38 AM, Evgeniy Stepanov <<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Android, allocations from static constructors of uninstrumented<br>
>> libraries occur before we have a chance to replace the allocator. This<br>
>> patch helps avoid crashing on the matching deallocations.<br>
><br>
><br>
</div></div></blockquote></div><br>