[LLVMdev] LLVM-based address sanity checker

Kostya Serebryany kcc at google.com
Thu Jun 16 12:20:16 PDT 2011


On Thu, Jun 16, 2011 at 11:10 PM, Renato Golin <rengolin at systemcall.org>wrote:

> On 16 June 2011 09:27, Kostya Serebryany <kcc at google.com> wrote:
> > Question to the LLVM developers: would you consider adding
> > the AddressSanitizer code to the LLVM trunk?
>
> Do you have an idea how hard would it be to port to non-x86 platforms?
> I saw some Intel ASM in the C++ file...
>
Not hard at all.
At some point the file had no asm at all, but using the custom asm allows to
make the generated code more compact.
Now, the code that actually reports the error is 5-6 bytes, we could
decrease it to 1 byte (at least on x86/x86_64) with some more work.
http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Report_Error
My first attempt that used no asm required ~15 bytes of code.
Note, this code is executed only once, so it affects the performance very
slightly (through icache size).


>
> The run-time library being 1.5k loc is not encouraging, but it didn't
> look particularly platform specific...
>

Alas. It will grow even more when we add MacOS support.
(currently, only tiny tests work on Mac).

--kcc

>
> cheers,
> --renato
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110616/10aa2757/attachment.html>


More information about the llvm-dev mailing list