Opened 7 months ago

Closed 9 days ago

#4073 closed defect (worksforme)

[raster] ST_AsRaster crashes when geometry touches pixels near a boundary

Reported by: lightinthedark Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.4.6
Component: raster Version: 2.4.x
Keywords: ST_AsRaster segfault Cc:

Description

The following query causes a segfault (process terminated with signal 11)

SELECT ST_AsRaster(
      ST_GeomFromText('POLYGON((4.5 3, 4.5 2.001, 3.5 1.999, 4.5 3))'),
      1::FLOAT, 1::FLOAT,
      0, 0, '1BB', 1, 0, 0, 0, true
  );

Changing the “touched” parameter to false or reducing the precision of the y value of the 2nd or 3rd points eliminates the error.


Running the mdillon/postgis:9.6-alpine docker image.

SELECT PostGIS_Full_Version();

POSTGIS="2.4.3" PGSQL="96" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.3, released 2017/11/20" LIBXML="2.9.5" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" (core procs from "2.4.3" need upgrade) TOPOLOGY (topology procs from "2.4.3" need upgrade) RASTER (raster procs from "2.4.3" need upgrade)

Change History (3)

comment:1 Changed 2 months ago by pramsey

Milestone: PostGIS 2.4.5PostGIS 2.4.6

comment:2 Changed 9 days ago by robe

I tested this on PostGIS 2.4.3 windows and didn't crash for me

POSTGIS="2.4.3 r16312" PGSQL="96" GEOS="3.6.1-CAPI-1.10.1 r4317" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, released 2018/03/19" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER PostgreSQL 9.6.10, compiled by Visual C++ build 1800, 64-bit

Also tried on 2.5.0

POSTGIS="2.5.0 r16836" [EXTENSION] PGSQL="100" GEOS="3.7.0-CAPI-1.11.0 3.7.0" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, released 2018/03/19" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER PostgreSQL 10.5, compiled by Visual C++ build 1800, 64-bit

So assume it's some alpine specific thing.

comment:3 Changed 9 days ago by robe

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.