[postgis-tickets] [PostGIS] #5315: ST_Buffer causes segfault

PostGIS trac at osgeo.org
Fri Jan 20 09:41:05 PST 2023


#5315: ST_Buffer causes segfault
----------------------+---------------------------
  Reporter:  ewie     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  blocker  |  Milestone:  PostGIS 3.2.4
 Component:  postgis  |    Version:  3.2.x
Resolution:           |   Keywords:
----------------------+---------------------------
Changes (by robe):

 * priority:  medium => blocker
 * milestone:   => PostGIS 3.2.4

Comment:

 Confirmed it crashes too

 {{{
 POSTGIS="3.3.2 3.3.2" [EXTENSION] PGSQL="150" GEOS="3.11.1-CAPI-1.17.1"
 SFCGAL="SFCGAL 1.4.1, CGAL 5.3, BOOST 1.78.0" PROJ="7.2.1" GDAL="GDAL
 3.4.3, released 2022/04/22" LIBXML="2.9.9" LIBJSON="0.12"
 LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER    PostgreSQL
 15.1, compiled by Visual C++ build 1914, 64-bit
 }}}



 {{{
 SELECT
   ST_Buffer(
     ST_Transform(
       ST_SetSRID(
         ST_GeomFromText(
           'MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)))',
           4326
         ),
         4647
       ),
       25832
     ),
     1
   );
 }}}

 But interestingly this doesn't crash:


 {{{
 SELECT

     ST_Transform(
       ST_SetSRID(
         ST_GeomFromText(
           'MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)))',
           4326
         ),
         4647
       ),
       25832
     );
 }}}

 and gives a:


 {{{
 MULTIPOLYGON(((Infinity Infinity,Infinity Infinity,Infinity
 Infinity,Infinity Infinity,Infinity Infinity)))
 }}}




 It doesn't crash on my Linux Debian Arm server
 running:

 {{{POSTGIS="3.3.2 4975da8" [EXTENSION] PGSQL="150"
 GEOS="3.10.2-CAPI-1.16.0" SFCGAL="SFCGAL 1.4.1, CGAL 5.3.1, BOOST 1.74.0"
 PROJ="8.2.1" GDAL="GDAL 3.4.1, released 2021/12/27" LIBXML="2.9.13"
 LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" (core procs
 from "3.3.0dev fef762990" need upgrade) TOPOLOGY (topology procs from
 "3.3.0dev fef762990" need upgrade) RASTER (raster procs from "3.3.0dev
 fef762990" need upgrade) (sfcgal procs from "3.3.0dev fef762990" need
 upgrade)    PostgreSQL 15.1 (Ubuntu 15.1-1.pgdg22.04+1) on aarch64
 -unknown-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0,
 64-bit}}}

 it gives error on both the ST_AsText and ST_Buffer


 {{{
 ERROR:  transform: Point outside of projection domain (2050)
 }}}

 So I guess the ultimate issue, is buffer can't buffer the infinity polygon
 which interestingly I can't cast back to a geometry. Gives invalid
 geometry if I try to do

 {{{
 SELECT ST_Buffer('MULTIPOLYGON(((Infinity Infinity,Infinity
 Infinity,Infinity Infinity,Infinity Infinity,Infinity
 Infinity)))'::geometry)
 }}}


 However on my Linux box


 {{{
 SELECT
 ST_Buffer('0106000020E86400000100000001030000000100000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry,
 10)
 }}}

 Gives a ERROR: SSL SYSCALL error: EOF detected

 which is not quite a crash but should never happen.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5315#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list