Boost C++ Libraries: Ticket #7801: Access violation using edge function and stored_ra_edge_iter https://svn.boost.org/trac10/ticket/7801 <p> I declare an adjacency_list as follows: </p> <pre class="wiki">struct MYvecS { }; template &lt;class ValueType&gt; struct container_gen&lt;MYvecS, ValueType&gt; { typedef std::vector &lt; ValueType, MyAllocator&lt; ValueType &gt; &gt; type; }; template &lt;&gt; struct parallel_edge_traits&lt;MYvecS&gt; { typedef allow_parallel_edge_tag type; }; namespace detail { // allow random access to NXvecS stored elements template &lt;&gt; struct is_random_access&lt;MYvecS&gt; { enum { value = true }; typedef mpl::true_ type; }; } </pre><pre class="wiki">typedef boost::adjacency_list &lt; MYvecS, MYvecS, boost::undirectedS, MYVertexType, MYEdgeType, no_property, MYvecS &gt; MyGraphType; </pre><p> I begin populating the graph with vertices and edges. If I use the <strong>edge</strong> function, passing in two valid vertices that are in the graph, the call to <strong><a class="missing wiki">StoredEdge</a>(v)</strong> crashes. </p> <p> Referencing lines 312 thru 314 of <strong>detail\adjacency_list.hpp</strong>, you'll see that when a single argument is passed to this method, the other two arguments assume default values. In this case <strong>edge_vec = 0</strong> and during this method call, it dereferences <strong>edge_vec</strong> which is set to NULL, and hence the access violation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7801 Trac 1.4.3 Jeremiah Willcock Mon, 17 Dec 2012 17:16:13 GMT <link>https://svn.boost.org/trac10/ticket/7801#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:1</guid> <description> <p> Does the implementation of <code>edge_range</code> that's there work with your allocator? If so, I'll change <code>edge</code> to match that implementation. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 17 Dec 2012 17:37:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7801#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82052" title="Trying to fix defaults for StoredEdge; refs #7801">[82052]</a>) Trying to fix defaults for <a class="missing wiki">StoredEdge</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7801" title="#7801: Bugs: Access violation using edge function and stored_ra_edge_iter (closed: fixed)">#7801</a> </p> </description> <category>Ticket</category> </item> <item> <author>Geoff Hammerle <geoff.hammerle@…></author> <pubDate>Mon, 17 Dec 2012 18:12:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7801#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:3</guid> <description> <p> I don't think I can use the edge_range because my container for the edges is not associative. I get the error: </p> <p> container_traits.hpp(550): error C2664: 'boost::graph_detail::equal_range_dispatch' : cannot convert parameter 3 from 'boost::graph_detail::vector_tag' to 'boost::graph_detail::associative_container_tag' </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 17 Dec 2012 18:19:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7801#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:4</guid> <description> <p> Does the version of <code>edge</code> currently in the trunk work for you? </p> </description> <category>Ticket</category> </item> <item> <author>Geoff Hammerle <geoff.hammerle@…></author> <pubDate>Mon, 17 Dec 2012 18:54:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7801#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:5</guid> <description> <p> Initial testing of the trunk version works for me just fine. I will do more extensive testing and report here either way success or failure. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Fri, 21 Dec 2012 01:51:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7801#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7801#comment:6</guid> <description> <p> Is this working? Should I close the bug? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Wed, 26 Dec 2012 19:41:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7801#comment:7 https://svn.boost.org/trac10/ticket/7801#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket