Hi Volker.

On 27/10/2014 07:39 μμ, Volker Schöch wrote:



Unfortunately I have not hear from you in this regard. It seems that I still cannot reliably reproduce the issue, but when it occurs, it occurs in the following scenario. Apparently, something is broken in your memory management:


{      // RT#8837

       _intPolygon polygonA;

       boost::geometry::read_wkt("MULTIPOLYGON(((488 2035,527 2035,527 2093,488 2093)))", polygonA); // does not throw


       _intRect rectB;

       boost::geometry::read_wkt("BOX(417 2064,597 2064)", rectB); // does not throw


       _intPolygon polygonC;

       boost::geometry::difference(polygonA, rectB, polygonC); // ACCESS VIOLATION



Maybe you could make an effort and step through this simple example once to see if everything works as expected?


I understand that the box and/or the polygon may not conform to all requirements (not spike-free etc.) but in any case, IMO the geometry library should not crash with a memory fault.


As always, my points are based on int and my polygons are counter-clockwise and not closed.


Please see the attached program and its output, which works for me.
Do you think you can reproduce the problem in a standalone program?

All the best,

- m.





Volker Schöch | vschoech@think-cell.com
Senior Software Engineer

We are looking for C++ Developers: http://www.think-cell.com/career

From: Geometry [mailto:geometry-bounces@lists.boost.org] On Behalf Of Volker Schöch
Sent: Freitag, 17. Oktober 2014 16:20
To: Boost.Geometry library mailing list (geometry@lists.boost.org)
Subject: [geometry] access violation in update_discarded(...)




we have seen an access violation deep inside boost geometry. We are still working on a simple reproduction, which may take while. In the meantime, maybe you have some idea what went wrong, or some suggestion how to avoid this situation?


Here is where it happened:


template<typename Turns, typename Operations>

inline void update_discarded(Turns& turn_points, Operations& operations)


    // Vice-versa, set discarded to true for discarded operations;

    // AND set discarded points to true

    for (typename boost::range_iterator<Operations>::type it = boost::begin(operations);

         it != boost::end(operations);



        if (turn_points[it->index].discarded) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< access violation


            it->discarded = true;


        else if (it->discarded)


            turn_points[it->index].discarded = true;





Please find the callstack attached.




Volker Schöch | vschoech@think-cell.com
Senior Software Engineer

We are looking for C++ Developers:http://www.think-cell.com/career

think-cell Software GmbH


Chausseestr. 8/E

phone / fax

+49 30 666473-10 / -19

10115 Berlin, Germany

US phone / fax

+1 800 891 8091 / +1 212 504 3039

Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306

Directors: Dr. Markus Hannebauer, Dr. Arno Schödl


Geometry mailing list