-
Notifications
You must be signed in to change notification settings - Fork 54
POST ST_3DDifference crashes with malformed polygon #108
Comments
Hi @robe2, Can you plz try:
Normaly validity is à pre-condition (src/algorithm/difference.cpp:426), so something is very wrong in the backtrace. Did you happen to compile with the cmake option SFCGAL_CHECK_VALIDITY=OFF ? |
NOTICE: Too few points in geometry component at or near point 1 2 |
Also verified same answer when backend is enabled:
same answer as strk's fa I think I didn't have the backend set to sfcgal, though I didn't think that would make a difference since this function is only provided by SFCGAL. strk - does it crash for you too? FWIW: vmora -- the ST_3DArea used to crash as well, but the 1.2 upgrade fixed that one. Though interestingly it looks like its still trying to do an area check but at least throwing an error:
|
My SFCGAL build config:
|
So, confirmed it is. |
On Thu, Aug 27, 2015 at 02:16:09AM -0700, Vincent Mora wrote:
Which switch makes it a "debug" build ? |
cmake -DCMAKE_BUILD_TYPE=Debug |
Ah, so "confirmed" it's the bug, not the fact that I'm using a debug build... Evidently while my box catches the floating-point exception Regina's windows box crashes. |
depends on the cgal version I guess (wild guess) because I get a CGAL assertion error here. |
Adding this to IsValidTest reveals that our IsValid is wrong on this case BOOST_AUTO_TEST_CASE( valid42 ) |
@vmora didn't we have a sfcgal_is_valid() in postgis some times ago ? |
@mhugo hugh ? What about the "can't find plane for Polygon" ? |
Foud the problem: the polygon is a point, and the IsValid of SFCGAL (that apparently is not called by postgis) yields True with this guy. I'm adding a test for this special case. |
I'm running CGAL 4.6.1 if that matters why I crash and you too don't. Could be just windows too cause I was testing on standard distributed PostgreSQL VC++ build (but all PostGIS parts are mingw compiled (including CGAL)) |
@robe2 I found the but, is valid was not catching the special case where polygon degenerates to a point (not valid). Adding test + fix to master. |
ticketed also in PostGIS at https://trac.osgeo.org/postgis/ticket/3255
This was testing with SFCGAL (1.2.0 - c2dfba1 ) on Windows 7 64-bit PostgreSQL 9.4.4
Backtrace looks like
The text was updated successfully, but these errors were encountered: