Boost C++ Libraries: Ticket #12207: allocate_shared using fast_pool_allocator results in member vector iterator memory corruption on MSVC https://svn.boost.org/trac10/ticket/12207 <p> Reproducer: </p> <pre class="wiki">#include &lt;vector&gt; #include &lt;boost/pool/pool_alloc.hpp&gt; struct TestStruct { std::vector&lt;int&gt; vec; }; int main() { //std::allocator&lt;TestStruct&gt; allocator; // works boost::fast_pool_allocator&lt;TestStruct&gt; allocator; auto test = std::allocate_shared&lt;TestStruct&gt;(allocator); test-&gt;vec.push_back(1); auto iter = test-&gt;vec.begin(); auto val = *iter; } </pre><p> When dereferencing iter it will assert "vector iterator not dereferencable" on MSVC (using 2015 Community Edition) everytime on 64-bit and sporadically on 32-bit. </p> <p> If you put a break point (or break after the assert) and check </p> <pre class="wiki">"iter" -&gt; "[Raw View]" -&gt; "std::_Vector_const_iterator ..." -&gt; "std::_Iterator012 ..." -&gt; "std::_Iterator_base12" -&gt; "_Myproxy" -&gt; "_Mycont" -&gt; "_Myproxy" </pre><p> you can see that the _Myproxy of _Mycont is "0xcccccccccccccccc" (uninitialized) when it should point to the _Myproxy of std::_Iterator_base12, forming a loop (which is the case when using std::allocator for the allocation). Note that the times it works when you compile on 32-bit the memory still seems to be corrupted (it's just not set to "0xcccccccccccccccc"). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12207 Trac 1.4.3