Opened 9 years ago
Closed 9 years ago
#3256 closed defect (fixed)
ST_3DDistance sfcgal garden crash on malformed polygons
Reported by: | robe | Owned by: | colivier |
---|---|---|---|
Priority: | high | Milestone: | PostGIS SFCGAL |
Component: | sfcgal | Version: | master |
Keywords: | Cc: |
Description
I think this is caused by a very recent change, because it wasn't crashing when I ran yesterday.
Now testing:
POSTGIS="2.2.0dev r13970" GEOS="3.5.0-CAPI-1.9.0 r4088" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.0, released 2015/06/14" LIBXML="2.7.8" LIBJSON="0.12" RASTER
I am getting a server crash o:
SELECT ST_3DDistance('POINT(-11.1111111 40)'::geometry, 'POLYGON((1 2,1 2,1 2,1 2))'::geometry);
Change History (10)
comment:1 by , 9 years ago
Component: | postgis → sfcgal |
---|
comment:2 by , 9 years ago
Owner: | changed from | to
---|
comment:3 by , 9 years ago
Priority: | blocker → high |
---|
Okay user ineptness. I remarked out the CREATE EXTENSION sfcgal part but forgot to remark out the part about changing the backend to sfcgal in my scripts.
comment:4 by , 9 years ago
Summary: | ST_3DDistance garden crash on malformed polygons → ST_3DDistance sfcgal garden crash on malformed polygons |
---|
comment:5 by , 9 years ago
I get an exception but not a crash,
postgis22=# set postgis.backend = 'sfcgal'; SET postgis22=# SELECT ST_3DDistance('POINT(-11.1111111 40)'::geometry, 'POLYGON((1 2,1 2,1 2,1 2))'::geometry); ERROR: floating-point exception DETAIL: An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero. postgis22=# set postgis.backend = 'geos'; SET postgis22=# SELECT ST_3DDistance('POINT(-11.1111111 40)'::geometry, 'POLYGON((1 2,1 2,1 2,1 2))'::geometry); NOTICE: One or both of the geometries is missing z-value. The unknown z-value will be regarded as "any value" st_3ddistance ------------------ 39.8833174657844 (1 row)
comment:6 by , 9 years ago
Same here (floating-point exception with sfcgal, notice with geos).
SFGAL 2.1 from commit 24db3b8a2aec64db6da32b1cc6bf4d4a3840b9f8
comment:8 by , 9 years ago
Which CGAL version are you guys using. I'm using CGAL 4.6.1 (though I recall I had the same issue with CGAL 4.2).
comment:9 by , 9 years ago
Oh by the way I had submitted this ticket to SFCGAL and it seems to be fixed now
https://github.com/Oslandia/SFCGAL/issues/108
I'll retest to confirm.
comment:10 by , 9 years ago
Milestone: | PostGIS 2.2.0 → PostGIS SFCGAL |
---|---|
Resolution: | → fixed |
Status: | new → closed |
confirmed it's fixed as of https://github.com/Oslandia/SFCGAL/commit/24db3b8a2aec64db6da32b1cc6bf4d4a3840b9f8
I now get
NOTICE: During distance_3d(A,B) : NOTICE: with A: POINT(-6254999476204023/562949953421312 40/1) NOTICE: and B: POLYGON((1/1 2/1,1/1 2/1,1/1 2/1,1/1 2/1)) ERROR: When converting to 3D - Polygon is invalid : ring 0 degenerated to a point : POLYGON((1/1 2/1 0/1,1/1 2/1 0/1,1/1 2/1 0/1,1/1 2/1 0/1)) ********** Error ********** ERROR: When converting to 3D - Polygon is invalid : ring 0 degenerated to a point : POLYGON((1/1 2/1 0/1,1/1 2/1 0/1,1/1 2/1 0/1,1/1 2/1 0/1)) SQL state: XX000
I did a backtrace of this, and it seems my sfcgal is kicking. I don't know why it didn't yesterday though so could still be something to do with the r13970 change or my ineptness. Going to recheck.
Anyway the crash appears to be in SFCGAL from the backtrace: