Boost C++ Libraries: Ticket #10896: astar_maze.cpp: Debug assertion under Windows MSVC-12 https://svn.boost.org/trac10/ticket/10896 <p> Dear maintainers, the example astar_maze.cpp compiled under Windows 7 x64 as 32 Bit executable, throws a debug assertion. See the callstack (attachment). I called this example without any arguments from the debugger so it used the default grid size of 20x20. </p> <p> The assertion get triggered at </p> <blockquote> <p> bucket_pointer get_bucket(std::size_t bucket_index) const </p> <blockquote> <p> { </p> </blockquote> </blockquote> <p> ---&gt; BOOST_ASSERT(buckets_); </p> <blockquote> <p> return buckets_ + static_cast&lt;std::ptrdiff_t&gt;(bucket_index); </p> </blockquote> <blockquote> <p> } </p> </blockquote> <p> buckets_ is nullptr. </p> <p> Environment: Windows 7 x 64 Visual Studio 2013 Update 4 Express for Desktop </p> <p> Attachments: </p> <ul><li>callstack </li><li>minidump </li><li>solution folder (compressed) </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10896 Trac 1.4.3 georg@… Wed, 24 Dec 2014 12:34:25 GMT attachment set https://svn.boost.org/trac10/ticket/10896 https://svn.boost.org/trac10/ticket/10896 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">astar-maze.zip</span> </li> </ul> Ticket anonymous Wed, 24 Dec 2014 12:34:40 GMT attachment set https://svn.boost.org/trac10/ticket/10896 https://svn.boost.org/trac10/ticket/10896 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">call-stack.txt</span> </li> </ul> Ticket georg@… Wed, 24 Dec 2014 12:36:14 GMT <link>https://svn.boost.org/trac10/ticket/10896#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10896#comment:1</guid> <description> <p> I decided to dont upload the minidump because the minidump is too big (40 MB). </p> </description> <category>Ticket</category> </item> <item> <author>georg@…</author> <pubDate>Wed, 24 Dec 2014 12:37:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10896#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10896#comment:2</guid> <description> <p> P.S.: I forgot to mention, under release build the executable doesnt dump and it solves the maze. </p> </description> <category>Ticket</category> </item> <item> <author>georg@…</author> <pubDate>Wed, 24 Dec 2014 12:44:37 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/10896#comment:3 https://svn.boost.org/trac10/ticket/10896#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">graph</span> </li> </ul> Ticket georg@… Fri, 26 Dec 2014 12:34:36 GMT attachment set https://svn.boost.org/trac10/ticket/10896 https://svn.boost.org/trac10/ticket/10896 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">astar_maze2.cpp</span> </li> </ul> <p> rewritten sample astar_maze2.cpp </p> Ticket georg@… Fri, 26 Dec 2014 12:35:12 GMT <link>https://svn.boost.org/trac10/ticket/10896#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10896#comment:4</guid> <description> <p> I added the rewritten sample. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 16 Dec 2015 14:35:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10896#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10896#comment:5</guid> <description> <p> A simpler solution would be to have random_maze function return a pointer to maze, as below. </p> <p> maze* random_maze(std::size_t x, std::size_t y) { </p> <blockquote> <p> maze* m = new maze(x, y); vertices_size_type n = num_vertices(m-&gt;m_grid); vertex_descriptor s = m-&gt;source(); vertex_descriptor g = m-&gt;goal(); <em> One quarter of the cells in the maze should be barriers. int barriers = n / 4; </em></p> </blockquote> <blockquote> <p> while (barriers &gt; 0) { </p> <blockquote> <p> <em> Choose horizontal or vertical direction. std::size_t direction = random_int(0, 1); </em> Walls range up to one quarter the dimension length in this direction. vertices_size_type wall = random_int(1, m-&gt;length(direction) / 4); <em> Create the wall while decrementing the total barrier count. vertex_descriptor u = vertex(random_int(0, n - 1), m-&gt;m_grid); while (wall) { </em></p> <blockquote> <p> <em> Start and goal spaces should never be barriers. if (u != s &amp;&amp; u != g) { </em></p> <blockquote> <p> wall--; if (!m-&gt;has_barrier(u)) { </p> <blockquote> <p> m-&gt;m_barriers.insert(u); barriers--; </p> </blockquote> <p> } </p> </blockquote> <p> } vertex_descriptor v = m-&gt;m_grid.next(u, direction); <em> Stop creating this wall if we reached the maze's edge. if (u == v) </em></p> <blockquote> <p> break; </p> </blockquote> <p> u = v; </p> </blockquote> <p> } </p> </blockquote> <p> } </p> </blockquote> <blockquote> <p> return m; </p> </blockquote> <p> } </p> </description> <category>Ticket</category> </item> </channel> </rss>