#1002 closed defect (fixed)
assertion failures with VS2017 / VS2019
Reported by: | dbaston | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.8.1 |
Component: | Default | Version: | 3.8.0 |
Severity: | Unassigned | Keywords: | |
Cc: |
Description
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]; + } }
Change History (6)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
Merge instructions, for local testing:
git checkout -b dbaston-trac-1002 master git pull https://github.com/dbaston/libgeos.git trac-1002
comment:4 by , 4 years ago
Not without adding these MSVC configurations to our CI. The code in question is already hit by our test suites; the bug is just optimized out.
PR at https://github.com/libgeos/geos/pull/244