<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 2:56 PM, Justin Bogner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</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? 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>
<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></blockquote><div><br></div><div>MemorySSA was only added a month or so ago, wasn't it? If it was added with UB in it, it should probably have been removed/fixed, no?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>
<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>
<span class=""><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>
</span>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>