<div dir="ltr">Seems like a nice idea to me. (Your test coverage is pretty weak, though.) Have you tried this much on large codebases? Does this find many bugs? (I can imagine it would be effective when combined with fuzz testing...)</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 3:39 PM, Will Dietz <span dir="ltr"><<a href="mailto:wdietz2@illinois.edu" target="_blank">wdietz2@illinois.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Recently I thought it would be useful to have a sanitizer for<br>
detecting overflows in pointer expressions.  Such overflows are<br>
undefined behavior and are pretty much always bugs.  While it's true<br>
that if such an overflowed pointer is dereferenced a tool such as ASan<br>
will catch the error, detection of these bugs when the occur helps fix<br>
them without requiring an input that triggers a crash.<br>
<br>
Two examples of this in the wild:<br>
<br>
* binutils undefined behavior bug that leads to segfault when built<br>
with clang[1]<br>
* ASTVector bug I just submitted patch for, discovered using this sanitizer[2]<br>
<br>
Attached are patches for clang and compiler-rt that implement this<br>
sanitizer and seem to work well in my testing so far.<br>
<br>
There is some work to do yet:<br>
<br>
* Adding lit tests to clang/compiler-rt<br>
* Finalizing what constructs are useful/worth checking (iterative<br>
process, I imagine)<br>
* More testing/benchmarking<br>
<br>
Before tackling the above, I was hoping to get some early feedback:<br>
<br>
* Is this something the community is interested in/would find useful?<br>
* Code review (the current implementation should be complete in terms<br>
of the checking code itself)<br>
<br>
Thank you for your time, here's to finding even more bugs! :)<br>
<br>
~Will<br>
<br>
[1] <a href="http://wdtz.org/undefined-behavior-in-binutils-causes-segfault.html" target="_blank">http://wdtz.org/undefined-behavior-in-binutils-causes-segfault.html</a><br>
[2] <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131028/091878.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131028/091878.html</a><br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>