[PATCH] Annotate our UB to sneak it past the sanitizers
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 15:29:19 PST 2016
On Fri, Feb 26, 2016 at 2:56 PM, Justin Bogner <mail at justinbogner.com>
> Alexey Samsonov <vonosmas at gmail.com> writes:
> > What are the failures you observe? We're running an UBSan bootstrap on
> > buildbot, and it's usually green:
> Is that running without any blacklists?
Hm, not really. cmake -DLLVM_USE_SANITIZER=Undefined expands to
but this specific error seem to be coming from -fsanitize=object-size.
> These are both the undefined
> behaviour in ilist_node and how we use it, ie:
> runtime error: downcast of address XXX with insufficient space for an
> object of type 'llvm::MachineBasicBlock'
> This is because "Sentinel" in both of these functions is an
> ilist_half_node, which is certainly not large enough.
> It's certainly been necessary to blacklist MachineFunction on darwin
> since at least October, though the bug existed and wasn't caught by
> ubsan before that:
> The one in MemorySSA just started hitting a month or so ago.
> > On Thu, Feb 25, 2016 at 2:42 PM, Kostya Serebryany <kcc at google.com>
> >> Sounds very scary.
> >> At the very least we should specify which flavor of UB we allow here
> >> just all of it)
> The macro expands to no_sanitize("undefined") right now - does
> no_sanitize take a more specific argument?
> > +1 I would prefer LLVM_NO_SANITIZE("kind") macro.
> Sure. I'll update the patch.
Yes, you can use smth. like
> >> And then comment why exactly we allow it.
> > Or leave a link to PR for eventually fixing this UB.
> Apparently a PR for this never got filed, though I know Duncan's done
> some work towards fixing it. I filed llvm.org/PR26753 just now.
> >> On Thu, Feb 25, 2016 at 1:19 PM, Justin Bogner <mail at justinbogner.com>
> >> wrote:
> >>> Attached patch silences -fsanitize=undefined wrt the UB we have for
> >>> ilist node sentinels. Okay to commit?
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits