Boost C++ Libraries: Ticket #8575: boost::polygon::operators::operator* crashes on a specific pair of polygons https://svn.boost.org/trac10/ticket/8575 <p> The issue appears to be caused by int overflow - if I halve the value of coordinates of both polygons operator* works correctly. </p> <p> Polygon1: (-2147483646, -2147483646), (429496729, -2147483646), (2147483646, 2147483646) </p> <p> Polygon2: (-1288490188, -2147483646), (1288490188, -2147483646), (1288490188, 2147483646), (-1288490188, 2147483646) </p> <p> Code snippet:<br /> </p> <pre class="wiki">namespace bp = boost::polygon; using namespace boost::polygon::operators; typedef bp::polygon_data&lt;int&gt; Polygon; typedef bp::polygon_traits&lt;Polygon&gt;::point_type Point; typedef std::vector&lt;Polygon&gt; PolygonSet; ... Polygon p1 = makeBoostPolygon(...); Polygon p2 = makeBoostPolygon(...); PolygonSet ps1; ps1 += p1; PolygonSet ps2; ps2 += p2; PolygonSet intersection; assign(intersection, ps1*ps2); // Crashes with access violation </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8575 Trac 1.4.3 Constantine Kozhukhin <ckozhukhin@…> Wed, 15 May 2013 12:29:44 GMT <link>https://svn.boost.org/trac10/ticket/8575#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8575#comment:1</guid> <description> <p> Forgot to mention - I observed the crash on Windows x64 in Visual Studio 2010 Express. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Sun, 09 Jun 2013 20:52:05 GMT</pubDate> <title>owner, status, milestone changed https://svn.boost.org/trac10/ticket/8575#comment:2 https://svn.boost.org/trac10/ticket/8575#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Lucanus Simonson</span> to <span class="trac-author">Andrii Sydorchuk</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket Andrii Sydorchuk Sun, 16 Jun 2013 01:46:00 GMT <link>https://svn.boost.org/trac10/ticket/8575#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8575#comment:3</guid> <description> <p> Hi, </p> <p> Thanks for the report. If possible, could you attach the full code snippet or file? </p> <p> Thanks, Andrii </p> </description> <category>Ticket</category> </item> <item> <author>ckozhukhin@…</author> <pubDate>Wed, 17 Jul 2013 19:13:15 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8575 https://svn.boost.org/trac10/ticket/8575 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">LargeIntCrash.zip</span> </li> </ul> <p> Crash reproducer </p> Ticket ckozhukhin@… Wed, 17 Jul 2013 19:18:58 GMT <link>https://svn.boost.org/trac10/ticket/8575#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8575#comment:4</guid> <description> <p> Andrii, I attached VC++ project with the reproducer. I used VS 2010 Express. In Debug configuration it triggers a debug assertion in line 45 </p> <pre class="wiki"> ps1 += p1; </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Wed, 06 Nov 2013 23:25:02 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/8575#comment:5 https://svn.boost.org/trac10/ticket/8575#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.55.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket Andrii Sydorchuk Tue, 19 Nov 2013 23:11:02 GMT attachment set https://svn.boost.org/trac10/ticket/8575 https://svn.boost.org/trac10/ticket/8575 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">8575.diff</span> </li> </ul> Ticket Andrii Sydorchuk Tue, 19 Nov 2013 23:11:31 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8575#comment:6 https://svn.boost.org/trac10/ticket/8575#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> <p> The issue was related to the integer overflow. I've fixed the problem. Please apply the attached patch or sync with the trunk branch: <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk/boost/polygon/"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk/boost/polygon/</a> </p> Ticket