[geos-devel] [GEOS] #1002: assertion failures with VS2017 / VS2019

GEOS geos-trac at osgeo.org
Wed Oct 23 18:02:38 PDT 2019


#1002: assertion failures with VS2017 / VS2019
------------------------+--------------------------
 Reporter:  dbaston     |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:  3.8.1
Component:  Default     |    Version:  3.8.0
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 Reported by Asa Packer:

 > If I build in Debug mode, with either VS2017 or VS2019, I get tons of
 assertion failures when I do ctest.  They all come from line 115 of
 MonotoneChainBuilder.cpp, which on the last time through the loop causes
 an access of an element one past the end of a std::vector.  Even if I
 ignore the assertion failures, the tests show as fails because the C
 runtime considers these to be fatal errors.

 Proposed fix:


 {{{
 --- geos-3.8.0/src/index/chain/MonotoneChainBuilder.cpp

 +++ geos-3.8.0/src/index/chain/MonotoneChainBuilder.cpp

 @@ -111,8 +111,10 @@

              }

          }

          ++last;

 -        prev = curr;

 -        curr = &pts[last];

 +        if (last < npts) {

 +            prev = curr;

 +            curr = &pts[last];

 +        }

      }
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/1002>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list