#994 closed defect (fixed)
Segfault in UnaryUnionOp (::buildGeometry, something with C++ strings!)
Reported by: | strk | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 3.9.0 |
Component: | Default | Version: | main |
Severity: | Unassigned | Keywords: | |
Cc: |
Description (last modified by )
See backtrace:
#0 0x00007f52990da583 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose() (this=0x7ffde4bb7940) at /usr/include/c++/7/bits/basic_string.h:220 #1 0x00007f52990da583 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (this=0x7ffde4bb7940, __in_chrg=<optimized out>) at /usr/include/c++/7/bits/basic_string.h:647 #2 0x00007f52990da583 in geos::geom::GeometryFactory::buildGeometry<__gnu_cxx::__normal_iterator<geos::geom::Point const**, std::vector<geos::geom::Point const*, std::allocator<geos::geom::Point const*> > > >(__gnu_cxx::__normal_iterator<geos::geom::Point const**, std::vector<geos::geom::Point const*, std::allocator<geos::geom::Point const*> > >, __gnu_cxx::__normal_iterator<geos::geom::Point const**, std::vector<geos::geom::Point const*, std::allocator<geos::geom::Point const*> > >) const (toofar=..., from=..., this=<optimized out>) at ../../../include/geos/geom/GeometryFactory.h:391 #3 0x00007f52990da583 in geos::operation::geounion::UnaryUnionOp::Union() (this=0x7ffde4bb7940) at UnaryUnionOp.cpp:85
Attachments (2)
Change History (20)
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:2 by , 5 years ago
comment:3 by , 5 years ago
Can be reproduced with QGIS testsuite:
ctest -R 'QgisAlgorithmsTest$' --output-on-failure
(tested in 3.4 stable branch of QGIS, and in master branch of QGIS)
comment:4 by , 5 years ago
Milestone: | → 3.8.0 |
---|
comment:5 by , 5 years ago
Can you turn it into a unit or XML test, for those of us who don't have a source build of QGIS lying around?
comment:7 by , 5 years ago
Without a reproduction on this, we need to punt it to 3.8.1 so we can have a release.
comment:10 by , 5 years ago
Milestone: | 3.8.0 → 3.9.0 |
---|
Punt it, I get the same segfault with GEOS-3.6 so this must be some issue in either my setup or QGIS...
comment:11 by , 5 years ago
I can reproduce this too with:
"/usr/bin/cmake" "-P" "/home/raul/dev/public/QGIS/build/python/plugins/processing/tests/ProcessingQgisAlgorithmsTest.cmake"
Is there an easy way to access and export the input of GEOSUnaryUnion_r
? Would g->toString() be enough
?
comment:12 by , 5 years ago
I've extracted the geometry and created an unit test that also reproduces the crash in my system. PR with the test: https://github.com/libgeos/geos/pull/237
comment:14 by , 5 years ago
Raúl, did you use a Docker file or similar to run the QGIS tests against GEOS master? If so, would you mind passing it along? It might well come in handy again.
comment:15 by , 5 years ago
Raúl, did you use a Docker file or similar to run the QGIS tests against GEOS master?
No, I've got GEOS master installed in the system and built QGIS from source. Since it's linked dynamically I've replaced the GEOS package with one that printed the input to a file (https://github.com/Algunenano/geos/commit/a81133bd808e40d3a31bc60bce53a20aa1aec8fe)
comment:16 by , 5 years ago
Wow, good catch ! I'm pretty sure I saw this with GEOS-3.6 too so please consider backporting to wherever it is needed
comment:17 by , 5 years ago
OverlapUnion
is new to 3.8 and std::move
is new to 3.7, so if there is an issue in 3.6 it must be something else.
comment:18 by , 5 years ago
I confirm the fix in master branch.
And I confirm my view on 3.6 was wrong, because make install
of
updated GEOS did not fix the crash at first, but required me to
rm -f /usr/local/libgeos* first
I guess it was an effect of the bug fixed with [d47ea8c428da1ed4957916c49268740b362db9fb/git]
Valgrind view of the matter: