<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 17, 2016 at 10:57 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Feb 17, 2016 at 10:48 AM, Dan Liew <span dir="ltr"><<a href="mailto:dan@su-root.co.uk" target="_blank">dan@su-root.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
Well I dug into Z3's codebase a little more and figured out what the<br>
problem was. If you're curious see [1].<br></blockquote><div><br></div></span><div>Neat bug. :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
What worries me more is that prior to a heap-use-after-free being<br>
reported there an out of bounds write occurs but ASan doesn't catch it<br>
which seems like a bug to me. Note I'm using Clang 3.7.1<br></span>...<span class=""><br>
This seems like a bug to me. Thoughts?<br></span></blockquote><div><br></div><div>m_segments is at the end of the clause_allocator object, which I'm assuming is allocated in another object sls here:</div><div><div>        clause_allocator m_alloc;              // clause allocator</div><div>        clause_vector    m_bin_clauses;        // binary clauses</div></div><div>The out-of-bounds access probably touches memory in m_bin_clauses.</div><div><br></div><div>One of ASan's limitations is that it can't currently catch intra-object overflow:</div><div><a href="https://github.com/google/sanitizers/wiki/AddressSanitizerIntraObjectOverflow" target="_blank">https://github.com/google/sanitizers/wiki/AddressSanitizerIntraObjectOverflow</a><br></div><div>There's a prototype that adds padding to make it possible to catch this kind of bug, but I haven't seen anyone pushing it forward for a while now.</div></div></div></div></blockquote><div>For practical purposes this does not exist yet :(  </div></div><br></div></div>