Boost C++ Libraries: Ticket #261: Dereferencing invalid iterator https://svn.boost.org/trac10/ticket/261 <pre class="wiki">boost 1.31.0, subgraph.hpp, line 179, function find_vertex(vertex_descriptor u_global) const; return std::make_pair((*i).second, i != m_local_vertex.end()); //if i == m_local_vertex.end() - iterator should not be dereferenced </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/261 Trac 1.4.3 Vladimir Prus Fri, 30 Apr 2004 06:13:39 GMT <link>https://svn.boost.org/trac10/ticket/261#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/261#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=321498 I think it's a bug indeed. I've fixed it locally, but before comitting I'd like to add a test. Could you provide a minimal example which fails/crashes unless this is fixed? </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>parakhin</dc:creator> <pubDate>Sat, 01 May 2004 21:13:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/261#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/261#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=1033441 Well, actually you can only make it crash consistently building with STLPort with _STLP_DEBUG macro defined - only then dereferencing invalid iterator is checked. In all other cases it may crush - or it may not (coz dereferencing an invalid iterator causes an undefined behavior) #define _STLP_DEBUG #include &lt;boost/config.hpp&gt; #include &lt;iostream&gt; #include &lt;boost/graph/subgraph.hpp&gt; #include &lt;boost/graph/adjacency_list.hpp&gt; #include &lt;boost/graph/graph_utility.hpp&gt; int main(int,char*[]) { using namespace boost; typedef adjacency_list_traits&lt;vecS, vecS, directedS&gt; Traits; typedef subgraph&lt; adjacency_list&lt;vecS, vecS, directedS, property&lt;vertex_color_t, int&gt;, property&lt;edge_index_t, int&gt; &gt; &gt; Graph; const int N = 6; Graph G0(N); enum { A, B, C, D, E, F}; Graph&amp; G1 = G0.create_subgraph(); add_vertex(C, G1); G1.find_vertex(78); return 0; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Sun, 31 Oct 2004 18:48:35 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/261#comment:3 https://svn.boost.org/trac10/ticket/261#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=249098 This bug has been fixed in 1.32.0: confirmed with libstdc++ debug mode. </pre> Ticket