[postgis-devel] ST_MaximumInscribedCircle madness

Regina Obe lr at pcorp.us
Thu Apr 20 15:33:41 PDT 2023


It did eventually finish on my 3.11.2 and 3.12 runs.

 

Took about 3 minutes total and ended with error:

 

ERROR:  Error calculating GEOSMaximumInscribedCircle.

 

 

From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] On Behalf Of Bruce Rindahl
Sent: Thursday, April 20, 2023 6:10 PM
To: PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
Subject: Re: [postgis-devel] ST_MaximumInscribedCircle madness

 

Confirming behavior on:

POSTGIS="3.2.1 3.2.1" [EXTENSION] PGSQL="140" GEOS="3.10.2-CAPI-1.16.0" PROJ="7.2.1" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)"

 

rebooting now...

 

On Thu, Apr 20, 2023 at 3:50 PM Regina Obe <lr at pcorp.us <mailto:lr at pcorp.us> > wrote:

We did close an infinite loop issue on ST_MaximumInscribedCircle recently, but given the latest GEOS 3.11.2 seems to be hanging on this (I also tested my few months old 3.12 branch) and this is not with infinite coordinates, I suppose it’s yet another issue of

 

https://github.com/libgeos/geos/pull/843

 

https://github.com/libgeos/geos/issues/821

 

 

I think it’s worth a ticket both on GEOS and PostGIS.

 

 

 

 

 

 

 

 

 

From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org <mailto:postgis-devel-bounces at lists.osgeo.org> ] On Behalf Of Rémi Cura
Sent: Thursday, April 20, 2023 5:38 PM
To: PostGIS Development Discussion <postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> >
Subject: [postgis-devel] ST_MaximumInscribedCircle madness

 

Hello dear Postgis devs!

I have a strange case to submit to you.

In a nutshell, trying to compute 

```SQL
SELECT ST_MaximumInscribedCircle( 'POLYGON ((59.3 100.00000000000001, 99.7 100.00000000000001, 99.7 100, 59.3 100, 59.3 100.00000000000001))') ;
```

causes it to run for many minutes until it eventually errors.

Worst, running this kind of computing on 12M geoms in parallel x6 created a postgres **segfault** and crashed my server (16 cores, 64GB).

(many more geoms are making this function unhappy).


/!\ Once this query starts, it can't be stopped by `pg_cancel_backend(pid)` or even `pg_terminate_backend(pid)`

--> This is pretty dangerous in my opinion.

 

 

The geometry is simple, it is a rectangle.

I obtained it through other geometry operations

It must be some kind of precision issue, I'm wondering if there is some kind of infinite loop going on or something.

 

My full code is something like that:

```SQL
SELECT env, diff, ST_MaximumInscribedCircle(diff)
FROM CAST ('some_polygon'as text ) as g
    , ST_Envelope(g) as env
    , ST_MakeEnvelope(0,0,100,100) as bound
    , ST_Difference(env, bound) as diff;
```

 

Not creating a bug ticket as I don't know if I'm simply abusing the function / using it in a way it should not.

 

 

POSTGIS="3.1.7 aafe1ff" [EXTENSION] PGSQL="140" GEOS="3.9.1-CAPI-1.14.2" PROJ="8.0.1" GDAL="GDAL 3.4.3, released 2022/04/22" LIBXML="2.9.1" LIBJSON="0.15" LIBPROTOBUF="1.3.2" WAGYU="0.5.0 (Internal)" RASTER

 

PostgreSQL 14.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit

_______________________________________________
postgis-devel mailing list
postgis-devel at lists.osgeo.org <mailto:postgis-devel at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/postgis-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20230420/eef01129/attachment.htm>


More information about the postgis-devel mailing list