[LLVMdev] load widening conflicts with AddressSanitizer

Kostya Serebryany kcc at google.com
Tue Jan 24 10:16:15 PST 2012


On Tue, Jan 24, 2012 at 10:04 AM, Joerg Sonnenberger <
joerg at britannica.bec.de> wrote:

> On Tue, Jan 24, 2012 at 10:23:06AM +0100, Duncan Sands wrote:
> > Hi Kostya,
> >
> > > [resurrecting an old mail thread about AddressSanitizer false positive
> caused by
> > > load widening]
> > >
> > > Once the Attribute::AddressSafety is set by clang (a separate patch),
> fixing
> > > this bug may look as simple as this:
> >
> > I don't get the point of an attribute.  There's plenty of code out there
> > that does wide loads like this directly (without them being created by
> the
> > optimizers) since, just like the optimizers, they know it is safe and a
> win.
> > The attribute won't help them.  It looks like a way of just hiding the
> real
> > problem, which seems to be that address sanitizer is overly strict.
>
> The approach taken by valgrind is to provide a preprocessor macro, so a
> validation build can disable such optional performance hacks.
>

True (to some extent it is equivalent to proposed __attribute__).
The difference is that valgrind's RUNNING_ON_VALGRIND (
http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq
)
is a dynamically executed code, while with asan we need something static.

--kcc



>
> Joerg
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120124/d883dbee/attachment.html>


More information about the llvm-dev mailing list