Opened 9 years ago
Closed 9 years ago
#8575 closed Bugs (fixed)
boost::polygon::operators::operator* crashes on a specific pair of polygons
Reported by: | Owned by: | Andrii Sydorchuk | |
---|---|---|---|
Milestone: | Boost 1.56.0 | Component: | polygon |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The issue appears to be caused by int overflow - if I halve the value of coordinates of both polygons operator* works correctly.
Polygon1: (-2147483646, -2147483646), (429496729, -2147483646), (2147483646, 2147483646)
Polygon2: (-1288490188, -2147483646), (1288490188, -2147483646), (1288490188, 2147483646), (-1288490188, 2147483646)
Code snippet:
namespace bp = boost::polygon; using namespace boost::polygon::operators; typedef bp::polygon_data<int> Polygon; typedef bp::polygon_traits<Polygon>::point_type Point; typedef std::vector<Polygon> 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
Attachments (2)
Change History (8)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | To Be Determined → Boost 1.55.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
Hi,
Thanks for the report. If possible, could you attach the full code snippet or file?
Thanks, Andrii
comment:4 by , 9 years ago
Andrii, I attached VC++ project with the reproducer. I used VS 2010 Express. In Debug configuration it triggers a debug assertion in line 45
ps1 += p1;
comment:5 by , 9 years ago
Milestone: | Boost 1.55.0 → To Be Determined |
---|
by , 9 years ago
comment:6 by , 9 years ago
Milestone: | To Be Determined → Boost 1.56.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
The issue was related to the integer overflow. I've fixed the problem. Please apply the attached patch or sync with the trunk branch: https://svn.boost.org/svn/boost/trunk/boost/polygon/
Forgot to mention - I observed the crash on Windows x64 in Visual Studio 2010 Express.