<div dir="ltr">Hi,<div><br></div><div>ST_MakeValid('MULTIPOLYGON EMPTY') crashes (any) GEOS in PostGIS 3.1.0 after the removal of EMPTY was dropped. </div><div><br></div><div>In PostGIS input functions and for Wagyu clipping library there's a set of fuzzers that make sure the function never crashes. </div><div>MakeValid in GEOS may be a good candidate for such a thing - it needs to output a Valid something and not crash on any input to be useful.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 10, 2020 at 5:48 PM Sandro Santilli <<a href="mailto:strk@kbt.io">strk@kbt.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Dec 10, 2020 at 12:16:40PM +0100, Sandro Santilli wrote:<br>
> On Thu, Dec 10, 2020 at 12:08:58PM +0100, Sandro Santilli wrote:<br>
> <br>
> > Odd, for a MULTIPOINT with empty components it seems to strip it.<br>
> > But I cannot add the test because it looks like EMPTY is not accepted<br>
> > in WKT:<br>
> > <br>
> > MULTIPOINT(EMPTY,1 1,EMPTY,0 0)<br>
> > ParseException: Expected number but encountered word: 'EMPTY')<br>
> <br>
> Ok, figured: it's just the PostGIS->GEOS->PostGIS roundtrip conversion<br>
> dropping those components !<br>
> <br>
> strk=# select ST_AsText(postgis_geos_noop('GEOMETRYCOLLECTION(POINT EMPTY, POINT(1 1))'));<br>
> st_astext<br>
> --------------------------------<br>
> GEOMETRYCOLLECTION(POINT(1 1))<br>
> (1 row)<br>
> <br>
> So, not related to GEOSMakeValid per-se, just with the adapter...<br>
<br>
For the record, in case anyone wants to follow:<br>
<a href="https://trac.osgeo.org/postgis/ticket/4814" rel="noreferrer" target="_blank">https://trac.osgeo.org/postgis/ticket/4814</a><br>
<br>
To be noted that actually passing those empty components<br>
to GEOS exposes crashes in GEOS (more on the ticket above)<br>
<br>
--strk;<br>
_______________________________________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org" target="_blank">geos-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geos-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geos-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br></div></div>