Opened 9 years ago

Closed 6 years ago

#3255 closed defect (fixed)

Garden crash SFCGAL ST_3DDifference with malformed polygons

Reported by: robe Owned by: colivier
Priority: high Milestone: PostGIS SFCGAL
Component: sfcgal Version: master
Keywords: Cc:

Description

On

POSTGIS="2.2.0dev r13966" GEOS="3.5.0-CAPI-1.9.0 r4088" SFCGAL="1.1.0" 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
SELECT ST_3DDifference('POINT(-11.1111111 40)'::geometry, 'POLYGON((1 2,1 2,1 2,1 2))'::geometry) As result

crashes server.

Attachments (1)

ticket_3255.patch.txt (1.2 KB ) - added by hmercier 6 years ago.
Patch to add a regression test for #3255

Download all attachments as: .zip

Change History (6)

comment:1 by robe, 9 years ago

POSTGIS="2.2.0dev r13992" GEOS="3.5.0-CAPI-1.9.0 r4088" SFCGAL="1.2.0" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.0.0, released 2015/06/14 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="0.12" RASTER

Still crashes.

Version 0, edited 9 years ago by robe (next)

comment:2 by robe, 9 years ago

Milestone: PostGIS 2.2.0PostGIS SFCGAL

comment:3 by hmercier, 6 years ago

Works as expected (returns an error) on a recent version:

POSTGIS="3.0.0dev r16844" [EXTENSION] PGSQL="100" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" SFCGAL="1.3.5" PROJ="Rel. 5.1.0, June 1st, 2018" LIBXML="2.9.4" LIBJSON="0.12.1"

test_sfcgal=# SELECT ST_3DDifference('POINT(-11.1111111 40)'::geometry, 'POLYGON((1 2,1 2,1 2,1 2))'::geometry) As result;
NOTICE:  During difference_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))
ERREUR:  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))

comment:4 by strk, 6 years ago

Regina: can you add a regress test for this case, so it is secured ?

by hmercier, 6 years ago

Attachment: ticket_3255.patch.txt added

Patch to add a regression test for #3255

comment:5 by strk, 6 years ago

Resolution: fixed
Status: newclosed

In 16846:

Add test for crash in SFCGAL ST_3DDifference

Closes #3255

Note: See TracTickets for help on using tickets.