Created attachment 175389 [details] patch to add test env and circumvent dynamic-cast problems Ports like databases/postgisXX, graphics/qgis and others depend on graphics/geos. At least with QGIS and PostGIS there are problems in some functionality, based on graphics/geos. Especially PostGIS 2.1 and 2.2 show crashes with small datasets on FreeBSD 10.x, 11.x and HEAD [1]. The problem is also observed on OSX>=10.6 [2]. After adding some lines to the ports Makefile to get 'make check' functional[3], and running the tests for graphics/geos, an assertion can be observed, as described in tests/unit/test-suite.log: ---> group: geos::geom::CoordinateArraySequenceFactory, test: test<1> problem: assertion failed tests summary: failures:1 ok:1037 FAIL geos_unit (exit status: 1) It turns out, that there is a dynamic-cast problem with newer base compiler suites, which can be circumvented[2]. The solution for FreeBSD is exactly the same as described for Mac OSX. After a rebuild of graphics/geos with 'CXXFLAGS=-Wnon-virtual-dtor -Woverloaded-virtual' all tests of GEOS are fine and also PostGIS does not crash on analyzing small datasets [1] anymore. The appended patch should - enable testing environment and add target 'check' - add CXXFLAGS=-Wnon-virtual-dtor -Woverloaded-virtual - bump PORTREVISION portlint -AC is happy. Tested with Poudriere for HEADa/i, 10.3a/i and 9.3a/i with no problems. [1] https://trac.osgeo.org/postgis/ticket/2985 [2] https://trac.osgeo.org/geos/wiki/BuildingOnUnixWithCMake [3] https://trac.osgeo.org/geos/ticket/299
Created attachment 175416 [details] corrected patch for optimization problem After looking into the testing problems with GEOS again, it seems to me, that my previous analysis founds not the real problem. Instead of changing CXXFLAGS=-Wnon-virtual-dtor -Woverloaded-virtual it should be sufficient to remove the optimization -O2 from CXXFLAGS in all Makefiles of the sources. I had success with post-configure: @${FIND} ${WRKSRC} -name Makefile -exec \ ${REINPLACE_CMD} -e \ 's|CXXFLAGS = \-O2|CXXFLAGS =|' \{\} \; With this change 'make check' produces no errors any more. ------- The conclusion, that a corrected graphics/geos port also avoid the crashes of PostGIS, described in comment #1, was also wrong. It turns out, the I erroneously built PostgreSQL ports with DEBUG option enabled. With disabled DEBUG option, the crashes can be observed again. So I am afraid, the problem is on the PostgreSQL side and not with GEOS.
I'm testing this patch and I'll commit it ASAP.
A commit references this bug: Author: sunpoet Date: Sat Nov 19 08:02:56 UTC 2016 New revision: 426351 URL: https://svnweb.freebsd.org/changeset/ports/426351 Log: - Fix geos::geom::CoordinateArraySequenceFactory assertion - Convert to new test framework - Bump PORTREVISION for package change PR: 213173 Submitted by: Rainer Hurling <rhurlin@gwdg.de> Changes: head/graphics/geos/Makefile
Thanks for really good suggestions you shared here. Hope you will share these kinds of things with us also in future. http://www.domyhomework4me.net/