<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 12, 2014 at 3:45 PM, Stephan Tolksdorf <span dir="ltr"><<a href="mailto:st@quanttec.com" target="_blank">st@quanttec.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 12.05.14 13:13, Kostya Serebryany wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do you have a test that demonstrates that? That would be very helpful.<br>
</blockquote>
<br></div>
In push_back for example, you annotate that the length increases by 1, but then you don't undo that annotation if the copy constructor of the element throws an exception. Afterwards the sanitizer can't properly check accesses to the end of the vector and the next time the vector calls __sanitizer_annotate_<u></u>contiguous_container it will pass a wrong old_mid pointer.<br>
</blockquote><div><br></div><div>Trying to build a test case with libc++ and exceptions... (not trivial, will take some time)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
And an unrelated issue: the documentation for __sanitizer_annotate_<u></u>contiguous_container states that the complete buffer should be unpoisened before it is deallocated. This doesn't seem to be happening in the destructor or in the deallocate function.</blockquote>
<div>Here we rely on the fact that vector is using the default allocator, which immediately calls delete, which itself unpoisons the memory chunk.   </div><div><br></div><div>--kcc </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
<br>
- Stephan<br>
<br>
</font></span></blockquote></div><br></div></div>