<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 2:56 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Alexey Samsonov <<a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a>> writes:<br>
> What are the failures you observe? We're running an UBSan bootstrap on our<br>
> buildbot, and it's usually green:<br>
> <a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11059" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11059</a><br>
<br>
</span>Is that running without any blacklists?</blockquote><div><br></div><div>Hm, not really. cmake -DLLVM_USE_SANITIZER=Undefined expands to "-fsanitize=undefined -fno-sanitize=vptr,function",</div><div>but this specific error seem to be coming from -fsanitize=object-size.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> These are both the undefined<br>
behaviour in ilist_node and how we use it, ie:<br>
<br>
  runtime error: downcast of address XXX with insufficient space for an object of type 'llvm::MachineBasicBlock'<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
This is because "Sentinel" in both of these functions is an<br>
ilist_half_node, which is certainly not large enough.<br>
<br>
It's certainly been necessary to blacklist MachineFunction on darwin<br>
since at least October, though the bug existed and wasn't caught by<br>
ubsan before that:<br>
<br>
  <a href="http://lists.llvm.org/pipermail/llvm-dev/2015-October/091115.html" rel="noreferrer" target="_blank">http://lists.llvm.org/pipermail/llvm-dev/2015-October/091115.html</a><br>
<br>
The one in MemorySSA just started hitting a month or so ago.<br>
<span class=""><br>
> On Thu, Feb 25, 2016 at 2:42 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
><br>
>> Sounds very scary.<br>
>> At the very least we should specify which flavor of UB we allow here (not<br>
>> just all of it)<br>
<br>
</span>The macro expands to no_sanitize("undefined") right now - does<br>
no_sanitize take a more specific argument?<br>
<span class=""><br>
> +1 I would prefer LLVM_NO_SANITIZE("kind") macro.<br>
<br>
</span>Sure. I'll update the patch.<br></blockquote><div><br></div><div>Yes, you can use smth. like __attribute__((no_sanitize("signed-integer-overflow")))</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
>> And then comment why exactly we allow it.<br>
>><br>
><br>
> Or leave a link to PR for eventually fixing this UB.<br>
<br>
</span>Apparently a PR for this never got filed, though I know Duncan's done<br>
some work towards fixing it. I filed <a href="http://llvm.org/PR26753" rel="noreferrer" target="_blank">llvm.org/PR26753</a> just now.<br></blockquote><div><br></div><div>Thanks!</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>
><br>
>> On Thu, Feb 25, 2016 at 1:19 PM, Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>><br>
>> wrote:<br>
>><br>
>>> Attached patch silences -fsanitize=undefined wrt the UB we have for<br>
>>> ilist node sentinels. Okay to commit?<br>
>>><br>
>>><br>
>><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>