From trac at osgeo.org Wed Apr 1 00:46:08 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 07:46:08 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.1f26da520a373f6044b888a41595e965@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): I have installed this version on a new server and am currently running it on other problem areas where we miss results. When running CreateTopology with zero precision, I encountered the following error: {{{ XX000: Side-location conflict: new edge starts in face 63 and ends in face 6876 }}} However, when I switch back to a precision of 1e?07, it works correctly for that area. At the moment, the main focus is to get the correct results. I will do more comparative testing of these two versions later and report back. Regarding the comment about running with zero tolerance: one drawback is that it leaves a big cleanup work for the post jobs. This typically involves removing a significant number of extra edges, which is time?consuming. -- Ticket URL: 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. From git at osgeo.org Wed Apr 1 08:11:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 08:11:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-423-g53280a4f6 Message-ID: <20260401151151.46954361C8@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 53280a4f683f696e8086609fd681d380519487b9 (commit) from eafd5af097db3b2b0541342923431dbcd214c386 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 53280a4f683f696e8086609fd681d380519487b9 Author: Paul Ramsey Date: Wed Apr 1 08:11:42 2026 -0700 See also updates diff --git a/doc/reference_overlay.xml b/doc/reference_overlay.xml index 7225cea18..16ffc5f90 100644 --- a/doc/reference_overlay.xml +++ b/doc/reference_overlay.xml @@ -1133,13 +1133,14 @@ MULTILINESTRING((3 4,4 5),(1 2,3 4)) See Also - , + , , , + , , , , - + ----------------------------------------------------------------------- Summary of changes: doc/reference_overlay.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Apr 1 12:04:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 12:04:56 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-426-gae9559672 Message-ID: <20260401190456.C66E034941@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via ae9559672d2e329cee44bd697bac8411b94af13f (commit) via 765787f0976adfe7ae83cbf4dabf7cb5188288b9 (commit) via 515152e7bf193e6d75831e3794d9d0610d9c7dae (commit) from 53280a4f683f696e8086609fd681d380519487b9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ae9559672d2e329cee44bd697bac8411b94af13f Author: Paul Ramsey Date: Wed Apr 1 12:04:51 2026 -0700 Add news entry for ST_CoverageEdges diff --git a/NEWS b/NEWS index be561f67a..a0a1146c4 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ This version requires GEOS 3.10 or higher * New Features * + - ST_CoverageEdges, returns MultiLinestring of distinct shared edges in + polygonal coverage (Paul Ramsey) - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey) - #5993, [topology] Add max_edges parameter to TopoGeo_AddLinestring (Sandro Santilli) commit 765787f0976adfe7ae83cbf4dabf7cb5188288b9 Author: Paul Ramsey Date: Wed Apr 1 12:03:17 2026 -0700 Implement ST_CoverageEdges using GEOSCoverageEdges from GEOS 3.15 diff --git a/doc/reference_coverage.xml b/doc/reference_coverage.xml index ccd8b868a..bad27160a 100644 --- a/doc/reference_coverage.xml +++ b/doc/reference_coverage.xml @@ -357,6 +357,76 @@ SELECT id, ST_AsText(ST_CoverageSimplify(geom, 30) OVER ()) + + + ST_CoverageEdges + + Computes the unique edges of a polygonal coverage. + + + + + + geometry ST_CoverageEdges + geometry + geom + integer + edgetype = 0 + + + geometry ST_CoverageEdges + geometry[] + geoms + integer + edgetype = 0 + + + + + + Description + + Returns a MultiLineString representing the unique edges of a polygonal coverage. + A polygonal coverage is a set of non-overlapping polygons where adjacent polygons have matching vertices along shared edges. + + The edgetype parameter can be used to select which edges are returned: + + 0 (ALL) - all unique edges (default) + 1 (EXTERIOR) - only exterior edges (non-shared) + 2 (INTERIOR) - only interior edges (shared) + + + + Availability: 3.7.0 + Requires GEOS >= 3.15.0 + + + + Examples + +-- Get all unique edges of a coverage +SELECT ST_AsText(ST_CoverageEdges(ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)), POLYGON((10 0, 20 0, 20 10, 10 10, 10 0)))'))); +-------------------------------------- +MULTILINESTRING((0 0, 10 0), (10 0, 20 0), (20 0, 20 10), (20 10, 10 10), (10 10, 0 10), (0 10, 0 0), (10 0, 10 10)) + +-- Get only interior (shared) edges +SELECT ST_AsText(ST_CoverageEdges(ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)), POLYGON((10 0, 20 0, 20 10, 10 10, 10 0)))'), 2)); +-------------------------------------- +MULTILINESTRING((10 0, 10 10)) + + + + + See Also + + , + , + + + + + + ST_CoverageUnion diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index 2870527fe..be55bdaba 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -982,6 +982,7 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) GEOSGeometry *geos = NULL; GEOSGeometry *geos_result = NULL; uint32 ngeoms = 0; + int srid = SRID_UNKNOWN; ArrayType *array = PG_GETARG_ARRAYTYPE_P(0); uint32 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); @@ -1006,6 +1007,10 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) gser = (GSERIALIZED *)DatumGetPointer(value); if (gserialized_is_empty(gser)) continue; + /* Get SRID from first non-null element */ + if (srid == SRID_UNKNOWN) + srid = gserialized_get_srid(gser); + /* Omit unconvertible */ geos = POSTGIS2GEOS(gser); if (!geos) continue; @@ -1015,7 +1020,9 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) array_free_iterator(iterator); if (ngeoms == 0) + { PG_RETURN_NULL(); + } geos = GEOSGeom_createCollection( GEOS_GEOMETRYCOLLECTION, @@ -1027,6 +1034,8 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) HANDLE_GEOS_ERROR("Geometry could not be converted"); } + GEOSSetSRID(geos, srid); + geos_result = GEOSCoverageUnion(geos); GEOSGeom_destroy(geos); if (!geos_result) @@ -1038,6 +1047,139 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } + +/********************************************************************** + * ST_CoverageEdges(geometry, edgetype) + * ST_CoverageEdges(geometry[], edgetype) + * + */ + +Datum ST_CoverageEdges(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(ST_CoverageEdges); +Datum ST_CoverageEdges(PG_FUNCTION_ARGS) +{ +#if POSTGIS_GEOS_VERSION < 31500 + lwpgerror("The GEOS version this PostGIS binary " + "was compiled against (%d) doesn't support " + "'ST_CoverageEdges' function (3.15.0+ required)", + POSTGIS_GEOS_VERSION); + PG_RETURN_NULL(); +#else + GSERIALIZED *result = NULL; + GSERIALIZED *gser = PG_GETARG_GSERIALIZED_P(0); + int edgetype = PG_GETARG_INT32(1); + GEOSGeometry *geos = NULL; + GEOSGeometry *geos_result = NULL; + + if (gserialized_is_empty(gser)) + PG_RETURN_NULL(); + + initGEOS(lwpgnotice, lwgeom_geos_error); + + geos = POSTGIS2GEOS(gser); + if (!geos) + HANDLE_GEOS_ERROR("Geometry could not be converted"); + + geos_result = GEOSCoverageEdges(geos, edgetype); + GEOSGeom_destroy(geos); + if (!geos_result) + HANDLE_GEOS_ERROR("Error computing coverage edges"); + + result = GEOS2POSTGIS(geos_result, LW_FALSE); + GEOSGeom_destroy(geos_result); + + PG_RETURN_POINTER(result); +#endif +} + +Datum ST_CoverageEdges_array(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(ST_CoverageEdges_array); +Datum ST_CoverageEdges_array(PG_FUNCTION_ARGS) +{ +#if POSTGIS_GEOS_VERSION < 31500 + lwpgerror("The GEOS version this PostGIS binary " + "was compiled against (%d) doesn't support " + "'ST_CoverageEdges' function (3.15.0+ required)", + POSTGIS_GEOS_VERSION); + PG_RETURN_NULL(); +#else + GSERIALIZED *result = NULL; + int edgetype = PG_GETARG_INT32(1); + + Datum value; + bool isnull; + + GEOSGeometry **geoms = NULL; + GEOSGeometry *geos = NULL; + GEOSGeometry *geos_result = NULL; + uint32 ngeoms = 0; + int srid = SRID_UNKNOWN; + + ArrayType *array = PG_GETARG_ARRAYTYPE_P(0); + uint32 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); + ArrayIterator iterator = array_create_iterator(array, 0, NULL); + + /* Return null on 0-elements input array */ + if (nelems == 0) + PG_RETURN_NULL(); + + /* Convert all geometries into GEOSGeometry array */ + geoms = palloc(sizeof(GEOSGeometry *) * nelems); + + initGEOS(lwpgnotice, lwgeom_geos_error); + + while (array_iterate(iterator, &value, &isnull)) + { + GSERIALIZED *gser; + /* Omit nulls */ + if (isnull) continue; + + /* Omit empty */ + gser = (GSERIALIZED *)DatumGetPointer(value); + if (gserialized_is_empty(gser)) continue; + + /* Get SRID from first non-null element */ + if (srid == SRID_UNKNOWN) + srid = gserialized_get_srid(gser); + + /* Omit unconvertible */ + geos = POSTGIS2GEOS(gser); + if (!geos) continue; + + geoms[ngeoms++] = geos; + } + array_free_iterator(iterator); + + if (ngeoms == 0) + { + PG_RETURN_NULL(); + } + + geos = GEOSGeom_createCollection( + GEOS_GEOMETRYCOLLECTION, + geoms, ngeoms); + + if (!geos) + { + coverage_destroy_geoms(geoms, ngeoms); + HANDLE_GEOS_ERROR("Geometry could not be converted"); + } + + GEOSSetSRID(geos, srid); + + geos_result = GEOSCoverageEdges(geos, edgetype); + GEOSGeom_destroy(geos); + if (!geos_result) + HANDLE_GEOS_ERROR("Error computing coverage edges"); + + result = GEOS2POSTGIS(geos_result, LW_FALSE); + GEOSGeom_destroy(geos_result); + + PG_RETURN_POINTER(result); +#endif +} + + extern Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(ST_MinimumSpanningTree); Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 41a7ee22a..649ed3fc5 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -4498,6 +4498,20 @@ CREATE OR REPLACE FUNCTION ST_CoverageClean (geom geometry, gapMaximumWidth floa LANGUAGE 'c' IMMUTABLE STRICT WINDOW PARALLEL SAFE _COST_HIGH; +-- Availability: 3.7.0 +CREATE OR REPLACE FUNCTION ST_CoverageEdges (geoms geometry[], edgetype integer default 0) + RETURNS geometry + AS 'MODULE_PATHNAME', 'ST_CoverageEdges_array' + LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE + _COST_HIGH; + +-- Availability: 3.7.0 +CREATE OR REPLACE FUNCTION ST_CoverageEdges (geom geometry, edgetype integer default 0) + RETURNS geometry + AS 'MODULE_PATHNAME', 'ST_CoverageEdges' + LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE + _COST_HIGH; + -------------------------------------------------------------------------------- -- Availability: 2.3.0 diff --git a/regress/core/coverage.sql b/regress/core/coverage.sql index 9c456410c..159022e83 100644 --- a/regress/core/coverage.sql +++ b/regress/core/coverage.sql @@ -101,3 +101,29 @@ FROM squares GROUP BY i, j ORDER By i, j; +------------------------------------------------------------------------ + +CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); + +INSERT INTO coverage_edges VALUES +(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), +(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); + +SELECT 'coverage edges all' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom))) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges exterior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges interior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges array' AS test, + ST_AsText(ST_CoverageEdges(array_agg(geom))) +FROM coverage_edges WHERE id = 6; + +DROP TABLE coverage_edges; + diff --git a/regress/core/coverage_expected b/regress/core/coverage_expected index 2b456107a..2a0304871 100644 --- a/regress/core/coverage_expected +++ b/regress/core/coverage_expected @@ -36,3 +36,7 @@ grid squares|1|2|50000 grid squares|2|0|50000 grid squares|2|1|50000 grid squares|2|2|10000 +coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges interior|MULTILINESTRING((10 10,10 0)) +coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) commit 515152e7bf193e6d75831e3794d9d0610d9c7dae Author: Paul Ramsey Date: Wed Apr 1 10:33:30 2026 -0700 Simplify stringbuffer handling a little diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c index 8db842117..9065bdf6f 100644 --- a/loader/shp2pgsql-core.c +++ b/loader/shp2pgsql-core.c @@ -1479,8 +1479,7 @@ ShpLoaderGetSQLHeader(SHPLOADERSTATE *state, char **strheader) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strheader = ret; @@ -1519,8 +1518,7 @@ ShpLoaderGetSQLCopyStatement(SHPLOADERSTATE *state, char **strheader) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strheader = ret; @@ -1851,14 +1849,13 @@ done_cell: /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strrecord = ret; /* If any warnings occurred, set the returned message string and warning status */ - if (strlen((char *)stringbuffer_getstring(sbwarn)) > 0) + if (stringbuffer_getlength(sbwarn) > 0) { snprintf(state->message, SHPLOADERMSGLEN, "%s", stringbuffer_getstring(sbwarn)); stringbuffer_destroy(sbwarn); @@ -1943,8 +1940,7 @@ ShpLoaderGetSQLFooter(SHPLOADERSTATE *state, char **strfooter) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strfooter = ret; ----------------------------------------------------------------------- Summary of changes: NEWS | 2 + doc/reference_coverage.xml | 70 ++++++++++++++++++++ loader/shp2pgsql-core.c | 14 ++-- postgis/lwgeom_window.c | 142 +++++++++++++++++++++++++++++++++++++++++ postgis/postgis.sql.in | 14 ++++ regress/core/coverage.sql | 26 ++++++++ regress/core/coverage_expected | 4 ++ 7 files changed, 263 insertions(+), 9 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 1 12:05:51 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 19:05:51 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.1663215e9cb801d76134db726d748e9b@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Replying to [comment:7 maxsynytsky1v]: > sql.xz originally and retried today with just txt but it is still undeliverable and the error is the same. Try emailing to me lr at pcorp dot us. If that doesn't work, I'll give you a nextcloud private link to upload it to. -- Ticket URL: 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. From git at osgeo.org Wed Apr 1 13:13:35 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 13:13:35 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-428-ga5ceec2d8 Message-ID: <20260401201335.CA2D5110209@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via a5ceec2d826c271bab53fc5614dc26c4d174bc9b (commit) via 953790c4b42241b7a37f36e846a1896a01a0ca15 (commit) from ae9559672d2e329cee44bd697bac8411b94af13f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a5ceec2d826c271bab53fc5614dc26c4d174bc9b Author: Paul Ramsey Date: Wed Apr 1 13:07:12 2026 -0700 Ensure ST_CoverageEdges tests are deterministic with ORDER BY diff --git a/regress/core/geos315.sql b/regress/core/geos315.sql index 4c30bfbfe..b30f0657a 100644 --- a/regress/core/geos315.sql +++ b/regress/core/geos315.sql @@ -51,19 +51,19 @@ INSERT INTO coverage_edges VALUES (6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); SELECT 'coverage edges all' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom))) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq))) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges exterior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq), 1)) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges interior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq), 2)) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges array' AS test, - ST_AsText(ST_CoverageEdges(array_agg(geom))) + ST_AsText(ST_CoverageEdges(array_agg(geom ORDER BY seq))) FROM coverage_edges WHERE id = 6; DROP TABLE coverage_edges; commit 953790c4b42241b7a37f36e846a1896a01a0ca15 Author: Paul Ramsey Date: Wed Apr 1 13:01:45 2026 -0700 Move ST_CoverageEdges and ST_MinimumSpanningTree tests to version-gated geos315 test file diff --git a/regress/core/coverage.sql b/regress/core/coverage.sql index 159022e83..9c456410c 100644 --- a/regress/core/coverage.sql +++ b/regress/core/coverage.sql @@ -101,29 +101,3 @@ FROM squares GROUP BY i, j ORDER By i, j; ------------------------------------------------------------------------- - -CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); - -INSERT INTO coverage_edges VALUES -(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), -(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); - -SELECT 'coverage edges all' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom))) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges exterior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges interior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges array' AS test, - ST_AsText(ST_CoverageEdges(array_agg(geom))) -FROM coverage_edges WHERE id = 6; - -DROP TABLE coverage_edges; - diff --git a/regress/core/coverage_expected b/regress/core/coverage_expected index 2a0304871..2b456107a 100644 --- a/regress/core/coverage_expected +++ b/regress/core/coverage_expected @@ -36,7 +36,3 @@ grid squares|1|2|50000 grid squares|2|0|50000 grid squares|2|1|50000 grid squares|2|2|10000 -coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) -coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) -coverage edges interior|MULTILINESTRING((10 10,10 0)) -coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) diff --git a/regress/core/spanningtree.sql b/regress/core/geos315.sql similarity index 66% rename from regress/core/spanningtree.sql rename to regress/core/geos315.sql index 063c18855..4c30bfbfe 100644 --- a/regress/core/spanningtree.sql +++ b/regress/core/geos315.sql @@ -1,4 +1,6 @@ +-- ST_MinimumSpanningTree + -- Connected graph (all one cluster) SELECT 'connected', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id) FROM (VALUES (1, 'LINESTRING(0 0,1 0)'::geometry), @@ -40,3 +42,28 @@ SELECT 'empty', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id), ST_AsText(g (6, 'LINESTRING(1 0,0 1)'::geometry) ) AS t(id, geom); +-- ST_CoverageEdges + +CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); + +INSERT INTO coverage_edges VALUES +(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), +(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); + +SELECT 'coverage edges all' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom))) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges exterior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges interior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges array' AS test, + ST_AsText(ST_CoverageEdges(array_agg(geom))) +FROM coverage_edges WHERE id = 6; + +DROP TABLE coverage_edges; diff --git a/regress/core/spanningtree_expected b/regress/core/geos315_expected similarity index 60% rename from regress/core/spanningtree_expected rename to regress/core/geos315_expected index 8421fd061..9eae3c024 100644 --- a/regress/core/spanningtree_expected +++ b/regress/core/geos315_expected @@ -22,3 +22,7 @@ empty|3|0|LINESTRING EMPTY empty|4|1|LINESTRING(1 1,1 0) empty|5|0|LINESTRING(0 0,1 1) empty|6|1|LINESTRING(1 0,0 1) +coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges interior|MULTILINESTRING((10 10,10 0)) +coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in index d34642e3d..fc998a755 100644 --- a/regress/core/tests.mk.in +++ b/regress/core/tests.mk.in @@ -168,7 +168,7 @@ endif ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31500),1) TESTS += \ - $(top_srcdir)/regress/core/spanningtree + $(top_srcdir)/regress/core/geos315 endif ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31200),1) ----------------------------------------------------------------------- Summary of changes: regress/core/coverage.sql | 26 --------------------- regress/core/coverage_expected | 4 ---- regress/core/{spanningtree.sql => geos315.sql} | 27 ++++++++++++++++++++++ .../{spanningtree_expected => geos315_expected} | 4 ++++ regress/core/tests.mk.in | 2 +- 5 files changed, 32 insertions(+), 31 deletions(-) rename regress/core/{spanningtree.sql => geos315.sql} (65%) rename regress/core/{spanningtree_expected => geos315_expected} (60%) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 1 16:56:07 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 23:56:07 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.465e7480ed6577c0ee8e7b67fc16789a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Still undeliverable. Also tried without extension at all just in case but still no luck. -- Ticket URL: 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. From git at osgeo.org Thu Apr 2 11:01:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 2 Apr 2026 11:01:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-429-g245ee074f Message-ID: <20260402180151.630A4117FB1@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 245ee074f2ca166f296a04ded14ad83c94978c32 (commit) from a5ceec2d826c271bab53fc5614dc26c4d174bc9b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 245ee074f2ca166f296a04ded14ad83c94978c32 Author: Paul Ramsey Date: Thu Apr 2 10:28:46 2026 -0700 Quiet CI warnings calling into GEOS CAPI function diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index be55bdaba..9b0e6e976 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -1227,7 +1227,7 @@ Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS) /* Note: GEOSMinimumSpanningTree signature assumed: size_t* GEOSMinimumSpanningTree(GEOSGeometry* const* geoms, size_t ngeoms); */ - cluster_ids = GEOSMinimumSpanningTree(geoms, ngeoms); + cluster_ids = GEOSMinimumSpanningTree((const GEOSGeometry * const *)geoms, ngeoms); if (cluster_ids) { ----------------------------------------------------------------------- Summary of changes: postgis/lwgeom_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 2 11:46:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 18:46:21 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.d9ff52d41b20be26abf2acadd925625d@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Replying to [comment:9 maxsynytsky1v]: > Still undeliverable. Also tried without extension at all just in case but still no luck. Here is a nextcloud drop link: https://nextcloud.osgeo.org/s/dgBPQrfJE6H3yWS Will let you only upload a file and only I can read it. -- Ticket URL: 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. From trac at osgeo.org Thu Apr 2 12:04:45 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:04:45 -0000 Subject: [PostGIS] #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix In-Reply-To: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> References: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> Message-ID: <064.7acd09f956ab320270c92d5ba8ab00a3@osgeo.org> #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix ----------------------+--------------------- Reporter: fthomas | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------+--------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: 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. From trac at osgeo.org Thu Apr 2 12:21:04 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:21:04 -0000 Subject: [PostGIS] #6038: Using public.geometry_columns causes 'could not open relation with OID 188954716' after drop geometry tables In-Reply-To: <050.410b70db9c436ac53a1e23f89f1c69ff@osgeo.org> References: <050.410b70db9c436ac53a1e23f89f1c69ff@osgeo.org> Message-ID: <065.9590a4600c9965774566a4376fab42c2@osgeo.org> #6038: Using public.geometry_columns causes 'could not open relation with OID 188954716' after drop geometry tables --------------------------------+-------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: blocker | Milestone: Component: topology | Version: master Resolution: | Keywords: --------------------------------+-------------------- Changes (by pramsey): * component: postgis => topology * owner: pramsey => strk -- Ticket URL: 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. From git at osgeo.org Thu Apr 2 12:27:57 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 2 Apr 2026 12:27:57 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-430-g8cfe6fe6d Message-ID: <20260402192757.9D6541166C2@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 8cfe6fe6de8906da79047f15d4a340a775aa1f51 (commit) from 245ee074f2ca166f296a04ded14ad83c94978c32 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8cfe6fe6de8906da79047f15d4a340a775aa1f51 Author: Paul Ramsey Date: Thu Apr 2 12:27:50 2026 -0700 Clarification per #6037 diff --git a/doc/xsl-config.xml b/doc/xsl-config.xml index 77437e98e..fb7904494 100644 --- a/doc/xsl-config.xml +++ b/doc/xsl-config.xml @@ -161,9 +161,9 @@ If the optional gridSize parameter is given (GEOS-3.9.0 or higher required), - all result vertices are guaranteed to fall on a grid of the specified - size. For the operation to give predictable results all the input vertices - must fall already on the specified grid, see . + all result vertices are guaranteed to fall on a snap-rounded grid of the specified + size. Note that operations performed on a grid may contain small artifacts + produced during grid alignment, see . ----------------------------------------------------------------------- Summary of changes: doc/xsl-config.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 2 12:28:12 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:28:12 -0000 Subject: [PostGIS] #6037: st_union with gridSize produces unexpected result In-Reply-To: <055.66fcb2bb2dfa7293cd8f6b12b8a210f3@osgeo.org> References: <055.66fcb2bb2dfa7293cd8f6b12b8a210f3@osgeo.org> Message-ID: <070.09a3efbd7e81626e9ef1588a06c8eb12@osgeo.org> #6037: st_union with gridSize produces unexpected result ------------------------------------+--------------------- Reporter: Asger Skovbo Petersen | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ------------------------------------+--------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed Comment: Changed at 8cfe6fe6d -- Ticket URL: 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. From trac at osgeo.org Thu Apr 2 13:13:15 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 20:13:15 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.ffa7948c970b353df33273ed8810f965@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): Hm, I just built out 3.4 and 3.5 against pg18 and I get the errors on *both* versions. -- Ticket URL: 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. From trac at osgeo.org Thu Apr 2 13:25:23 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 20:25:23 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.22fafdad05aaf31550530d55f7961abe@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): Shorter reproducer, just one row. {{{ CREATE TABLE reproduce AS SELECT 1 AS id, ST_GeomFromText('POLYGON ((133917.695 490000, 133708.3 491825.92, 133541.312 491951.805, 133460 491840, 132820 491000, 132210 490190, 132460 490000, 132700 490000, 133894.531 490000, 133917.695 490000))', 28992)::GEOMETRY(POLYGON, 28992) AS geometry; CREATE INDEX idx_reproduce_geometry ON reproduce USING GIST(geometry); SET enable_seqscan = OFF; SELECT id, geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992) AS opdist, ST_Distance(geometry, ST_SetSRID(ST_MakePoint(133718, 489222), 28992)) AS funcdist FROM reproduce; SELECT id FROM reproduce ORDER BY geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992); }}} -- Ticket URL: 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. From trac at osgeo.org Thu Apr 2 15:50:35 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 22:50:35 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.aff4b3cf1cb383788393e96317829f96@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): And building 3.4 and 3.5 against _pg16_ I still get errors on _both_ versions. -- Ticket URL: 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. From trac at osgeo.org Fri Apr 3 22:53:32 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 04 Apr 2026 05:53:32 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.f4ccffb49794996e0fc99904beafd3aa@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by Lars Aksel Opsahl): * Attachment "error_test_38_1_4.sql" added. -- Ticket URL: 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. From trac at osgeo.org Fri Apr 3 23:03:18 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 04 Apr 2026 06:03:18 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.256aa01a738f48c731baae55beb8b0ba@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Running branch t6062-fix with POSTGIS="3.7.0dev 3.6.0rc2-418-g790ef7815", I now get the following error when running this file: {{{ LOCATION: exec_stmt_raise, pl_exec.c:3910 error | id1 | id2 -----------------------------+-----+-------- mixed face labeling in ring | -19 | [NULL] (1 row) }}} When running the older branch 3.7.0dev 3.6.0rc2-305-g3b3488ddf, I do not get any errors. Running with a tolerance of 1e-07 on t6062-fix also seems to avoid the error, but that may causes problems elsewhere. -- Ticket URL: 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. From trac at osgeo.org Mon Apr 6 14:58:29 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 06 Apr 2026 21:58:29 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.3884daead6d1a69dc2117908689481be@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): So, doing a little digging into the debugger, I find that: * The index distance between the bounds of the polygon and the point is exactly 778. * Meanwhile, the "exact" distance between the polygon and the point is... less. {{{ SELECT ST_Distance( 'LINESTRING(132700 490000, 133894.531 490000)', 'POINT(133718 489222)' ); st_distance ------------------- 777.9999999999999 }}} -- Ticket URL: 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. From trac at osgeo.org Mon Apr 6 14:59:17 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 06 Apr 2026 21:59:17 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.5fd194afb4cf61150269b969d8e55a65@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Changes (by pramsey): * Attachment "Screenshot 2026-04-06 at 2.58.52?PM.png" added. Test Point and Polygon that are exhibiting the behaviour -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:24:51 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:24:51 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring Message-ID: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring ----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Keywords: | ----------------------+-------------------- As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology can be corrupted without exception by using TopoGeo_addLinestring. Test attached. This is a spin-off of #6062 Full version: {{{ POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:25:21 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:25:21 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a033d2d1e74090c3ff00b27276cb2e3e@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "error_test_38_1_4.sql" added. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:26:25 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:26:25 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.2bb6060ace125793242956414ef89532@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): I can actually reproduce the silent topology corruption with current master branch, I filed #6064 for that. Will try the version you reported (3b3488ddf) and update that ticket. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:30:10 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:30:10 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.fd4b295755e14ce9f58d22b9fcc4a230@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I can also reproduce with the version reported by Lars as working: {{{ PostgreSQL 18.3 (Debian 18.3-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit Postgis 3.7.0dev - (3.6.0rc2-305-g3b3488ddf) - 2026-04-07 07:27:12 GEOS: 3.14.2dev-CAPI-1.20.5 }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:41:02 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:41:02 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a5f977ff4cbdba7091fd6225d1cc8762@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): Passing 0 as the tolerance to the last `TopoGeo_addLinestring` prevents the silent corruption. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 00:59:47 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:59:47 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.7361acd68250ef5c90de42dc3925eb90@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "t6064.sql" added. Simplified testcase -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 01:15:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 08:15:56 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.87d460a3a4c2647936827f6b0e544643@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): The resulting topology contains edges that are very short: {{{ postgis_reg=# select edge_id, ST_Length(geom) from t6064.edge; edge_id | st_length ---------+------------------------ 6 | 0.20166820447100725 1 | 2.5110321484918296e-07 4 | 2.5110321655621793e-07 3 | 0.2017140909558352 2 | 3.1201241416250513e-13 5 | 3.6487597516463005e-13 }}} The computed snap tolerance (when NOT passing 0 as the tolerance) is `2.48862579345703e-13` so those tiny edges are still longer than tolerance. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 01:53:20 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 08:53:20 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a8c8ca7a8c0ab44213af71e9e0f333cc@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by Lars Aksel Opsahl): * cc: Lars Aksel Opsahl (added) -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 03:29:58 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:29:58 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.1097709c6b712e245b695e80ffe13bf7@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "screen.png" added. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 03:37:47 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:37:47 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.5d7ec3d24663529ef6512f696839bac8@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I've further reduced the test to pre-split the incoming line into the 3 edges that would result by the internal splitting, and added each one in turn, until I got the exception. Unfortunately I found that even BEFORE ValidateTopology reports an error, there is already a clear error, as you can see from this picture, there's a "face 2" reported to be on the left and right sides of an edge that should have the universe face there instead. This means the corruption happens BEFORE ValidateTopology can tell. [[Image(screen.png)]] -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 03:40:29 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:40:29 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.77a6d07ed62b345b40b1fcad7000f81c@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): That worked, thanks. I have just uploaded the compressed data set and the script to create the table. To reproduce just run {{{ psql -f gf_active_play_area.sql -h host db user }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 03:45:57 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:45:57 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling Message-ID: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling ----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Keywords: | ----------------------+--------------------------- As reported in https://trac.osgeo.org/postgis/ticket/6064#comment:5 we have a case in which ValidateTopology fails to find bogus left_face and right_face labeling. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 03:59:40 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:59:40 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.429582bd2698161f18d02b7cc9ea21e9@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I filed #6065 for the problem of ValidateTopology not seeing the problem eariler -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 07:51:41 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 14:51:41 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.f4586c17387ec35392275081bc67741c@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Test: {{{ SELECT NULL FROM topology.CreateTopology ('t6065'); INSERT INTO t6065.node (node_id, geom) VALUES ( 1, 'POINT(17.42207545158684 69.11091383590066)' ), ( 2, 'POINT(17.622976580401446 69.12848944101118)' ), ( 3, 'POINT(17.42207545158653 69.11091383590062)' ), ( 4, 'POINT(17.422075702665087 69.11091383235977)' ); INSERT INTO t6065.face (face_id, mbr) VALUES ( 1, 'POLYGON((17.42207545158684 69.11091383235974,17.42207545158684 69.11091383590066,17.422075702665087 69.11091383590066,17.422075702665087 69.11091383235974,17.42207545158684 69.11091383235974))' ), ( 2, 'POLYGON((17.42207545158653 69.11091383235974,17.42207545158653 69.12848944101118,17.622976580401446 69.12848944101118,17.622976580401446 69.11091383235974,17.42207545158653 69.11091383235974))' ); INSERT INTO t6065.edge (edge_id,start_node,end_node,next_left_edge,next_right_edge,left_face,right_face,geom) VALUES ( 1,1,4,3,4,2,1,'LINESTRING(17.42207545158684 69.11091383590066,17.422075702665087 69.11091383235977)' ), ( 2,3,1,1,2,2,2,'LINESTRING(17.42207545158653 69.11091383590062,17.42207545158684 69.11091383590066)' ), ( 3,4,2,-3,-4,2,2,'LINESTRING(17.422075702665087 69.11091383235977,17.579930758184094 69.12294910230447,17.622976580401446 69.12848944101118)' ), ( 4,1,4,-1,-2,1,2,'LINESTRING(17.42207545158684 69.11091383590066,17.42207570266477 69.11091383235974,17.422075702665087 69.11091383235977)' ); SELECT 'invalidities', * FROM topology.ValidateTopology('t6065'); }}} The problem is with computing winding order of rings, in presence of dangling edges. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 08:41:42 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 15:41:42 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace (was: Silent topology corruption with topology.TopoGeo_addLinestring) In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.24ae5f0ed26a94a6e7ecf58f17e0f36b@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * summary: Silent topology corruption with topology.TopoGeo_addLinestring => Silent topology corruption with topology.ST_AddEdgeModFace Old description: > As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology > can be corrupted without exception by using TopoGeo_addLinestring. > > Test attached. > > This is a spin-off of #6062 > > Full version: > {{{ > POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" > GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF > URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj > DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) > LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 > (Internal)" TOPOLOGY > }}} New description: As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology can be corrupted without exception by using ST_AddEdgeModFace. Test attached. This is a spin-off of #6062 Full version: {{{ POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Comment: Further simplification of the test, completely removing the code that takes care of noding. This one ONLY uses `ST_AddEdgeModFace`: {{{ SELECT NULL FROM topology.CreateTopology ('t6064'); SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.42207545158684 69.11091383590066)'); -- n1 SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.622976580401446 69.12848944101118)'); -- n2 SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.42207545158653 69.11091383590062)'); -- n3 SELECT 't6064.1', count(*) FROM topology.ST_AddEdgeModFace('t6064', 1, 2, 'LINESTRING( 17.42207545158684 69.11091383590066, 17.422075702665087 69.11091383235977, 17.579930758184094 69.12294910230447, 17.622976580401446 69.12848944101118 )'); SELECT 't6064.2', count(*) FROM topology.ST_AddEdgeModFace('t6064', 3,1, 'LINESTRING( 17.42207545158653 69.11091383590062, 17.42207545158684 69.11091383590066 )'); -- valid thus far -- Silently corrupts topology, updating edge 1 side faces as it thinks -- left side is a new face (it isn't). -- The code finds rings on BOTH sides of this new edge to be counterclockwise -- but instead only one side of them is. -- -- This is likely due to the presence of very long dangling edges. -- SELECT 't6064.3', count(*) FROM topology.ST_AddEdgeModFace('t6064', 1, 3, 'LINESTRING( 17.42207545158684 69.11091383590066, 17.42207570266477 69.11091383235974, 17.42207545158653 69.11091383590062 )' ); }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 08:43:25 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 15:43:25 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.d82ea1007b6770fbee3ae28b303ba60e@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Changes (by strk): * keywords: => robustness Comment: Note that the topology corruption introduced will NOT be detected by ValidateTopology, but is easily spotted by looking at the left/right face labels of the longest edge which are clearly wrong. The lack of reporting by ValidateTopology is handled in #6065 -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 10:25:08 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 17:25:08 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test Message-ID: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> #6066: Pg19 + topology crash on regression test ---------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Keywords: | ---------------------+--------------------------- In the `topology/test/regress/droptopogeometrycolumn.sql` test set, the line below causes a backend crash in Pg19 of recent vintage. First observed in CI some time after April 2, the last good build. {{{ INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); WARNING: resource was not closed: relation "node" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "node" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "node_primary_key" WARNING: resource was not closed: relation "node_primary_key" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 10:40:30 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 17:40:30 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.4dbd12cd254ee84220b7fcb28006d262@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): Backtrace at point of crash does not provide much guidance {{{ * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT * frame #0: 0x0000000182e545e8 libsystem_kernel.dylib`__pthread_kill + 8 frame #1: 0x0000000182e8f8d8 libsystem_pthread.dylib`pthread_kill + 296 frame #2: 0x0000000182d96790 libsystem_c.dylib`abort + 148 frame #3: 0x000000010460c0f0 postgres`ExceptionalCondition(conditionName=, fileName=, lineNumber=2192) at assert.c:65:2 [opt] frame #4: 0x00000001045ffa5c postgres`RelationDecrementReferenceCount(rel=) at relcache.c:2192:2 [opt] [inlined] frame #5: 0x00000001045ffa44 postgres`RelationClose(relation=) at relcache.c:2213:2 [opt] frame #6: 0x000000010414c8d8 postgres`index_close(relation=, lockmode=0) at indexam.c:185:2 [opt] frame #7: 0x000000010459f2dc postgres`ri_FastPathTeardown at ri_triggers.c:4152:4 [opt] [inlined] frame #8: 0x000000010459f298 postgres`ri_FastPathEndBatch(arg=) at ri_triggers.c:4130:2 [opt] frame #9: 0x000000010429b24c postgres`FireAfterTriggerBatchCallbacks at trigger.c:6861:3 [opt] frame #10: 0x000000010429b208 postgres`AfterTriggerEndQuery(estate=) at trigger.c:5240:2 [opt] frame #11: 0x00000001042c1000 postgres`standard_ExecutorFinish(queryDesc=0x0000000c1914a900) at execMain.c:445:3 [opt] frame #12: 0x00000001042c0f18 postgres`ExecutorFinish(queryDesc=) at execMain.c:413:3 [opt] [artificial] frame #13: 0x00000001044c40dc postgres`ProcessQuery(plan=0x0000000c190078d0, sourceText="INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1);", params=0x0000000000000000, queryEnv=0x0000000000000000, dest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:189:2 [opt] frame #14: 0x00000001044c36b0 postgres`PortalRunMulti(portal=0x0000000c19022100, isTopLevel=true, setHoldSnapshot=false, dest=0x0000000c18ca9110, altdest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:0 [opt] frame #15: 0x00000001044c3044 postgres`PortalRun(portal=0x0000000c19022100, count=9223372036854775807, isTopLevel=, dest=0x0000000c18ca9110, altdest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:783:5 [opt] frame #16: 0x00000001044c2054 postgres`exec_simple_query(query_string="INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1);") at postgres.c:1288:10 [opt] frame #17: 0x00000001044bf300 postgres`PostgresMain(dbname=, username=) at postgres.c:0:24 [opt] frame #18: 0x00000001044bad5c postgres`BackendMain(startup_data=, startup_data_len=) at backend_startup.c:124:2 [opt] frame #19: 0x0000000104404ba4 postgres`postmaster_child_launch(child_type=, child_slot=1, startup_data=0x000000016bd1e7f0, startup_data_len=24, client_sock=0x000000016bd1dd60) at launch_backend.c:265:3 [opt] frame #20: 0x0000000104408fec postgres`BackendStartup(client_sock=0x000000016bd1dd60) at postmaster.c:3627:8 [opt] [inlined] frame #21: 0x0000000104408f18 postgres`ServerLoop at postmaster.c:1722:6 [opt] frame #22: 0x0000000104406f9c postgres`PostmasterMain(argc=, argv=) at postmaster.c:1412:11 [opt] frame #23: 0x000000010431c904 postgres`main(argc=3, argv=0x00000001065fe870) at main.c:231:4 [opt] frame #24: 0x0000000182ad3da4 dyld`start + 6992 }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 11:53:35 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 18:53:35 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.89ca4c1fa48898bd8082b9cbc1310e48@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by Lars Aksel Opsahl): * cc: Lars Aksel Opsahl (added) -- Ticket URL: 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. From git at osgeo.org Tue Apr 7 12:20:22 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 7 Apr 2026 12:20:22 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-431-g3c92f0325 Message-ID: <20260407192022.4EAA1191763@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 (commit) from 8cfe6fe6de8906da79047f15d4a340a775aa1f51 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 Author: Sandro Santilli Date: Tue Apr 7 21:20:09 2026 +0200 Make function definition more readable diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in index 3611de981..4dff69603 100644 --- a/topology/sql/manage/ValidateTopology.sql.in +++ b/topology/sql/manage/ValidateTopology.sql.in @@ -35,7 +35,7 @@ CREATE TYPE topology.ValidateTopology_ReturnType AS ( -- Availability: 3.6.0 -- Changed: 3.6.0 uses bigint for IDs -- Replaces _validatetopologygetfaceshellmaximaledgering(varchar, integer) deprecated in 3.6.0 -CREATE OR REPLACE FUNCTION topology._validatetopologygetfaceshellmaximaledgering(atopology varchar, aface bigint) +CREATE OR REPLACE FUNCTION topology._ValidateTopologyGetFaceShellMaximalEdgeRing(atopology varchar, aface bigint) RETURNS GEOMETRY AS $BODY$ DECLARE ----------------------------------------------------------------------- Summary of changes: topology/sql/manage/ValidateTopology.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 7 12:36:50 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 19:36:50 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.05f8a87c20107935fbdc481d3310ff4a@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Using a `long double` instead of a `double` in the signed-area function fixes this case, making ST_IsPolygonCCW more robust. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 12:37:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 19:37:56 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.83222a3b50b6c60d754386497da3689d@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Comment (by strk): Using a `long double` instead of a `double` in the signed-area function fixes this case, making `ptarray_isccw` more robust. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 14:03:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 21:03:56 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.865e4ff419a90907d18eb1ecf5e6dab1@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The problem is that due to the numerical limit in `ST_IsPolygonCCW`, the 2 rings in the topology are both considered shells (both CCW) and none is considered an hole. -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 14:57:46 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 21:57:46 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.effc8f78365af2d21cde25ade361621e@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The `long double` fix is in https://gitea.osgeo.org/postgis/postgis/pulls/290 with the associated regression test -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 15:36:50 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 22:36:50 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.0242decdecb52ac937bfdb1812dfb491@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): From the test, here is the crash sequence {{{ -- Drop corrupted topology (with missing layer sequence) -- See http://trac.osgeo.org/postgis/ticket/5118 SELECT NULL FROM topology.CreateTopology('t5118'); CREATE TABLE t5118f (id int); SELECT NULL FROM topology.AddTopoGeometryColumn('t5118', 'public', 't5118f', 'g', 'LINE'); INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 15:43:14 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 22:43:14 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.e4a29a579c685164f8a249fa0837db33@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): How I am exercising this {{{ # clean database dropdb postgis_reg ./regress/run_test.pl --nodrop --topology ./regress/core/wkt psql postgis_reg }}} Setup the scenario {{{ SELECT NULL FROM topology.CreateTopology('t5118'); CREATE TABLE t5118f (id int); SELECT NULL FROM topology.AddTopoGeometryColumn('t5118', 'public', 't5118f', 'g', 'LINE'); }}} Hit the red buttton {{{ INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); }}} -- Ticket URL: 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. From trac at osgeo.org Tue Apr 7 21:36:56 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 04:36:56 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.a30bec1a4edf4c5b545f2db0c89c5e0b@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): It's not crashing for Paul but he is getting an invalid geometry {{{ ERROR: parse error - invalid geometry HINT: "..." <-- parse error at position 1131025 within geometry CONTEXT: COPY gf_active_play_area, line 596, column shape: "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.4676..." }}} So I suppose related to a corrupt geometry. For me it crashes somewhere in the strncat() parsing function so very low level in my msvcrt. I'm running on windows / mingw64/msys. I haven't tried one of my Linux boxes yet. -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 01:55:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 01:55:45 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-432-g7e3d523cd Message-ID: <20260408085545.A57D41942EF@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 7e3d523cda37faa3efdb8daed91e73df6a9fe864 (commit) from 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Author: Sandro Santilli Date: Tue Apr 7 23:53:43 2026 +0200 Use long double during signed area computation, improving robustness Fixes #6065 in 3.7.0dev Includes regression test diff --git a/NEWS b/NEWS index a0a1146c4..5d3de8494 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,11 @@ This version requires GEOS 3.10 or higher - #2614, Use GEOSPreparedDistance and caching to accelerate ST_DWithin (Paul Ramsey) - GH-839, ST_Multi support for TIN and surfaces (Lo?c Bartoletti) +* Enhancements * + + - #6065, Improved winding order computation robustness for rings having collapsed elements + (Sandro Santilli) + * Bug Fixes * - Build PostgreSQL extension modules with `-fno-semantic-interposition` when diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 54cfe875e..df5782adb 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1080,7 +1080,7 @@ ptarray_signed_area(const POINTARRAY *pa) const POINT2D *P1; const POINT2D *P2; const POINT2D *P3; - double sum = 0.0; + long double sum = 0.0; double x0, x, y1, y2; uint32_t i; diff --git a/topology/test/regress/validatetopology.sql b/topology/test/regress/validatetopology.sql index 173e4a5b1..aa852bb0d 100644 --- a/topology/test/regress/validatetopology.sql +++ b/topology/test/regress/validatetopology.sql @@ -222,3 +222,24 @@ ROLLBACK; SELECT NULL FROM topology.DropTopology('city_data'); +-- See https://trac.osgeo.org/postgis/ticket/6065 +BEGIN; +SELECT NULL FROM topology.CreateTopology ('t6065'); +INSERT INTO t6065.node (node_id, geom) VALUES +( 1, 'POINT(17.42207545158684 69.11091383590066)' ), +( 2, 'POINT(17.622976580401446 69.12848944101118)' ), +( 3, 'POINT(17.42207545158653 69.11091383590062)' ), +( 4, 'POINT(17.422075702665087 69.11091383235977)' ); +INSERT INTO t6065.face (face_id, mbr) +VALUES +( 1, 'POLYGON((17.42207545158684 69.11091383235974,17.42207545158684 69.11091383590066,17.422075702665087 69.11091383590066,17.422075702665087 69.11091383235974,17.42207545158684 69.11091383235974))' ), +( 2, 'POLYGON((17.42207545158653 69.11091383235974,17.42207545158653 69.12848944101118,17.622976580401446 69.12848944101118,17.622976580401446 69.11091383235974,17.42207545158653 69.11091383235974))' ); +INSERT INTO t6065.edge (edge_id,start_node,end_node,next_left_edge,next_right_edge,left_face,right_face,geom) +VALUES +( 1,1,4,3,4,2,1,'LINESTRING(17.42207545158684 69.11091383590066,17.422075702665087 69.11091383235977)' ), +( 2,3,1,1,2,2,2,'LINESTRING(17.42207545158653 69.11091383590062,17.42207545158684 69.11091383590066)' ), +( 3,4,2,-3,-4,2,2,'LINESTRING(17.422075702665087 69.11091383235977,17.579930758184094 69.12294910230447,17.622976580401446 69.12848944101118)' ), +( 4,1,4,-1,-2,1,2,'LINESTRING(17.42207545158684 69.11091383590066,17.42207570266477 69.11091383235974,17.422075702665087 69.11091383235977)' ); +SELECT '#6065', 'invalidities', * FROM topology.ValidateTopology('t6065'); +ROLLBACK; + diff --git a/topology/test/regress/validatetopology_expected b/topology/test/regress/validatetopology_expected index da497ee20..5f667e048 100644 --- a/topology/test/regress/validatetopology_expected +++ b/topology/test/regress/validatetopology_expected @@ -46,3 +46,4 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| +#6065|invalidities|hole not in advertised face|-4| ----------------------------------------------------------------------- Summary of changes: NEWS | 5 +++++ liblwgeom/ptarray.c | 2 +- topology/test/regress/validatetopology.sql | 21 +++++++++++++++++++++ topology/test/regress/validatetopology_expected | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 01:56:01 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 08:56:01 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.6fdc35d4b231d02eb9f6d7a26ff7cedd@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"7e3d523cda37faa3efdb8daed91e73df6a9fe864/git" 7e3d523/git]: {{{#!CommitTicketReference repository="git" revision="7e3d523cda37faa3efdb8daed91e73df6a9fe864" Use long double during signed area computation, improving robustness Fixes #6065 in 3.7.0dev Includes regression test }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 02:08:42 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 02:08:42 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-433-gcf42b890b Message-ID: <20260408090843.1C13219534E@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via cf42b890bf892d5498af532f1e8804355b44e71d (commit) from 7e3d523cda37faa3efdb8daed91e73df6a9fe864 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/topo/lwgeom_topo.c | 31 ++-------------------- topology/test/regress/topogeo_addlinestring.sql | 25 +++++++++++++++++ .../test/regress/topogeo_addlinestring_expected | 1 + 4 files changed, 29 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 02:08:45 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:08:45 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.517fb650f0cca8bd22ae5daa1039e34f@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: fixed | Keywords: --------------------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"cf42b890bf892d5498af532f1e8804355b44e71d/git" cf42b89/git]: {{{#!CommitTicketReference repository="git" revision="cf42b890bf892d5498af532f1e8804355b44e71d" Stop using recursive snapping during topology building Fixes #6062 Includes regression test }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 02:23:04 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 02:23:04 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-434-gacc6afbd9 Message-ID: <20260408092304.83B0B1956B4@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via acc6afbd9212beaf8e2039c7f2369584a6c9ec77 (commit) from cf42b890bf892d5498af532f1e8804355b44e71d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit acc6afbd9212beaf8e2039c7f2369584a6c9ec77 Author: Sandro Santilli Date: Thu Jan 29 11:33:51 2026 +0100 FindVertexSegmentPairsBelowDistance function References #6034 Includes tests and documentation diff --git a/NEWS b/NEWS index 19c16e4bc..1a59e317b 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ This version requires GEOS 3.10 or higher * New Features * + - [topology] FindVertexSegmentPairsBelowDistance function (Sandro Santilli) - ST_CoverageEdges, returns MultiLinestring of distinct shared edges in polygonal coverage (Paul Ramsey) - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey) diff --git a/doc/extras_topology.xml b/doc/extras_topology.xml index 4b0aa308a..31fe66eaf 100644 --- a/doc/extras_topology.xml +++ b/doc/extras_topology.xml @@ -3313,6 +3313,47 @@ and is thus usable to build edge ring linking. + + + FindVertexSegmentPairsBelowDistance + + + Find pairs of topology vertex/segment that are closer than tolerated distance + + + + + + + setof record FindVertexSegmentPairsBelowDistance + varchar atopology + float8 tolerance + + + + + + Description + + +Returns a relation in which each tuple is a pair of vertex/segment where +the vertex is NOT an endpoint of the segment but the distance between +them is below the given tolerance. + + + + Availability: 3.7 + + + + + See Also + + + + + + diff --git a/topology/Makefile.in b/topology/Makefile.in index 25cae0bfa..3319cf98c 100644 --- a/topology/Makefile.in +++ b/topology/Makefile.in @@ -130,12 +130,13 @@ topology.sql: \ sql/polygonize.sql.in \ sql/export/gml.sql.in \ sql/export/TopoJSON.sql.in \ - sql/query/getnodebypoint.sql.in \ + sql/query/FindVertexSegmentPairsBelowDistance.sql.in \ sql/query/getedgebypoint.sql.in \ sql/query/getfacebypoint.sql.in \ - sql/query/GetRingEdges.sql.in \ - sql/query/GetNodeEdges.sql.in \ sql/query/GetFaceContainingPoint.sql.in \ + sql/query/getnodebypoint.sql.in \ + sql/query/GetNodeEdges.sql.in \ + sql/query/GetRingEdges.sql.in \ sql/manage/AddTopoGeometryColumn.sql.in \ sql/manage/CopyTopology.sql.in \ sql/manage/CreateTopology.sql.in \ diff --git a/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in b/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in new file mode 100644 index 000000000..8d5096235 --- /dev/null +++ b/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in @@ -0,0 +1,46 @@ +-- Finds pairs of vertice/segment from a topology that are below a given distance. +-- The vertex must NOT be part of the segment. +-- +-- Presence of such proximities represent a missed snap opportunity during topology building +-- and can sometime be fixed by adding a new node where the vertex is, like: +-- +-- SELECT topology.TopoGeo_AddPoint('topo', ST_PointN(geom,v.vert)) +-- FROM topo.edge, LATERAL topology.findVertexSegmentPairsBelowDistance('topo', 1e-6) v +-- WHERE edge_id = v.vert_edge; +-- +CREATE OR REPLACE FUNCTION topology.findVertexSegmentPairsBelowDistance(toponame varchar, tolerance float8) +RETURNS TABLE (seg_edge int, segno int, vert_edge int, vertno int, vert_geom geometry) +AS $BODY$ +DECLARE + sql text; +BEGIN + sql := format($$ + SELECT + e1.edge_id seg_edge, + s.path[1] segno, + e2.edge_id vert_edge, + p.path[1] vertno, + p.geom vert_geom + FROM + %1$I.edge e1, + %1$I.edge e2, + LATERAL ST_DumpSegments(e1.geom) s, + LATERAL ST_DumpPoints(e2.geom) p + WHERE + e1.edge_id != e2.edge_id + AND ST_Expand(e1.geom, %2$L) && e2.geom + AND ST_Distance(s.geom, p.geom) < %2$L + AND NOT ( + ST_Equals(p.geom, ST_PointN(s.geom, 1)) + OR + ST_Equals(p.geom, ST_PointN(s.geom, 2)) + ) + $$, + toponame, + tolerance + ); + + RETURN QUERY EXECUTE sql; +END; +$BODY$ +LANGUAGE 'plpgsql'; diff --git a/topology/test/regress/findvertexsegmentpairsbelowdistance.sql b/topology/test/regress/findvertexsegmentpairsbelowdistance.sql new file mode 100644 index 000000000..ac3aac9b0 --- /dev/null +++ b/topology/test/regress/findvertexsegmentpairsbelowdistance.sql @@ -0,0 +1,11 @@ +\set VERBOSITY terse +set client_min_messages to ERROR; + +\i :top_builddir/topology/test/load_topology.sql + +SELECT 't1', 'count', count(*) FROM topology.FindVertexSegmentPairsBelowDistance('city_data', 1); +SELECT 't2', seg_edge, segno, vert_edge, vertno, ST_AsText(vert_geom) +FROM topology.FindVertexSegmentPairsBelowDistance('city_data', 1.1) +ORDER BY 1,2,3,4; + +SELECT NULL FROM topology.DropTopology('city_data'); diff --git a/topology/test/regress/findvertexsegmentpairsbelowdistance_expected b/topology/test/regress/findvertexsegmentpairsbelowdistance_expected new file mode 100644 index 000000000..000575dbb --- /dev/null +++ b/topology/test/regress/findvertexsegmentpairsbelowdistance_expected @@ -0,0 +1,12 @@ +t1|count|0 +t2|1|1|2|5|POINT(17 30) +t2|1|2|2|5|POINT(17 30) +t2|1|4|26|1|POINT(4 31) +t2|1|4|26|4|POINT(4 34) +t2|1|4|26|5|POINT(4 31) +t2|1|5|26|1|POINT(4 31) +t2|1|5|26|2|POINT(7 31) +t2|1|5|26|5|POINT(4 31) +t2|2|4|1|2|POINT(16 30) +t2|2|4|1|3|POINT(16 38) +t2|2|5|1|2|POINT(16 30) diff --git a/topology/test/tests.mk b/topology/test/tests.mk index ba1d2e204..3c70599d7 100644 --- a/topology/test/tests.mk +++ b/topology/test/tests.mk @@ -99,5 +99,6 @@ TESTS += \ $(top_srcdir)/topology/test/regress/validatetopology.sql \ $(top_srcdir)/topology/test/regress/validatetopology_large.sql \ $(top_srcdir)/topology/test/regress/verifylargeids.sql \ - $(top_srcdir)/topology/test/regress/fix_topogeometry_columns.sql + $(top_srcdir)/topology/test/regress/fix_topogeometry_columns.sql \ + $(top_srcdir)/topology/test/regress/findvertexsegmentpairsbelowdistance.sql diff --git a/topology/topology.sql.in b/topology/topology.sql.in index c364af34d..e96d9068e 100644 --- a/topology/topology.sql.in +++ b/topology/topology.sql.in @@ -1379,6 +1379,7 @@ LANGUAGE 'plpgsql' VOLATILE STRICT; #include "sql/query/getedgebypoint.sql.in" #include "sql/query/getfacebypoint.sql.in" #include "sql/query/GetFaceContainingPoint.sql.in" +#include "sql/query/FindVertexSegmentPairsBelowDistance.sql.in" -- Populating #include "sql/populate.sql.in" ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + doc/extras_topology.xml | 41 +++++++++++++++++++ topology/Makefile.in | 7 ++-- .../FindVertexSegmentPairsBelowDistance.sql.in | 46 ++++++++++++++++++++++ .../findvertexsegmentpairsbelowdistance.sql | 11 ++++++ .../findvertexsegmentpairsbelowdistance_expected | 12 ++++++ topology/test/tests.mk | 3 +- topology/topology.sql.in | 1 + 8 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in create mode 100644 topology/test/regress/findvertexsegmentpairsbelowdistance.sql create mode 100644 topology/test/regress/findvertexsegmentpairsbelowdistance_expected hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 02:23:06 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:23:06 -0000 Subject: [PostGIS] #6034: Missing node when adding overlapping line In-Reply-To: <050.00fe4cf3809caf26d3d25a602c774226@osgeo.org> References: <050.00fe4cf3809caf26d3d25a602c774226@osgeo.org> Message-ID: <065.2393f9ae7b4c045d8990cbd2cf322e41@osgeo.org> #6034: Missing node when adding overlapping line --------------------------------+------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+------------------- Comment (by Sandro Santilli ): In [changeset:"acc6afbd9212beaf8e2039c7f2369584a6c9ec77/git" acc6afbd/git]: {{{#!CommitTicketReference repository="git" revision="acc6afbd9212beaf8e2039c7f2369584a6c9ec77" FindVertexSegmentPairsBelowDistance function References #6034 Includes tests and documentation }}} -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 02:57:38 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:57:38 -0000 Subject: [PostGIS] #1502: Unrobustness in distance calculations In-Reply-To: <049.6e99c90e0fdd841800c1505295190a4c@osgeo.org> References: <049.6e99c90e0fdd841800c1505295190a4c@osgeo.org> Message-ID: <064.cccdee629f57588f3d5bbaaa43d3899e@osgeo.org> #1502: Unrobustness in distance calculations ----------------------+--------------------------- Reporter: nicklas | Owner: nicklas Type: defect | Status: closed Priority: medium | Milestone: PostGIS 2.0.0 Component: postgis | Version: 1.5.X Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by strk): for the record, the test for this started failing at some point, see https://gitlab.com/postgis/postgis/-/jobs/13826180367#L2607 -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 03:28:46 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 03:28:46 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-435-g2c9277d3d Message-ID: <20260408102846.C2C78195FAE@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 2c9277d3da0794f44dee60107d107cfd9939edeb (commit) from acc6afbd9212beaf8e2039c7f2369584a6c9ec77 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2c9277d3da0794f44dee60107d107cfd9939edeb Author: Sandro Santilli Date: Wed Apr 8 12:27:36 2026 +0200 Add topology test for ticket 6064 The test would fail if we reverted commit 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Closes #6064 diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index aadf897f6..f54145537 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -630,3 +630,26 @@ SELECT 't6062.edges', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6062', ORDER BY 2; SELECT 't6062.2', 'error', * FROM topology.ValidateTopology('t6062') v; SELECT NULL FROM topology.DropTopology ('t6062'); + +-- See https://trac.osgeo.org/postgis/ticket/6064 +set client_min_messages to WARNING; +SELECT NULL FROM topology.CreateTopology ('t6064'); +SELECT 't6064.1', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', +'LINESTRING( + 17.42207545158684 69.11091383590066, + 17.422075702665087 69.11091383235977, + 17.579930758184094 69.12294910230447 + , 17.622976580401446 69.12848944101118 +)'); + +SELECT 't6064.check.intermediate', * FROM topology.ValidateTopology('t6064'); +set client_min_messages to DEBUG; +SELECT 't6064.2', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', +'LINESTRING( + 17.42207545158653 69.11091383590062, + 17.42207570266477 69.11091383235974, + 17.622976580401076 69.12848944101118 +)'); +set client_min_messages to WARNING; +SELECT 't6064.check.final', * FROM topology.ValidateTopology('t6064'); +SELECT NULL FROM topology.DropTopology ('t6064'); diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected index 5ef1bb81a..a698decff 100644 --- a/topology/test/regress/topogeo_addlinestring_expected +++ b/topology/test/regress/topogeo_addlinestring_expected @@ -234,3 +234,5 @@ ERROR: Adding line to topology requires creating more edges than the requested t6023.1|errors| t6023.2|errors| t6062.edges|t +t6064.1|t +t6064.2|t ----------------------------------------------------------------------- Summary of changes: topology/test/regress/topogeo_addlinestring.sql | 23 ++++++++++++++++++++++ .../test/regress/topogeo_addlinestring_expected | 2 ++ 2 files changed, 25 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 03:28:48 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 10:28:48 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.b6c982dd9e7ae309459ad8b37700b55a@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+------------------------ Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"2c9277d3da0794f44dee60107d107cfd9939edeb/git" 2c9277d3/git]: {{{#!CommitTicketReference repository="git" revision="2c9277d3da0794f44dee60107d107cfd9939edeb" Add topology test for ticket 6064 The test would fail if we reverted commit 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Closes #6064 }}} -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 06:32:46 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 13:32:46 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.c0cf3cf6654fe8e84064d10762641dac@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Here is the backtrace: {{{ #0 0x00007fff9380b91e in strncat () from C:\WINDOWS\System32\msvcrt.dll #1 0x00007ffef562e04d in lwmessage_truncate ( str=0x229f2af816d "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.46761900 46.63984000, 15.46857900 46.63916700, 15.46950600 46.63848600, 15.47039300 46.63779600, 15.4712"..., startpos=startpos at entry=0, endpos=1131024, maxlength=maxlength at entry=40, truncdirection=truncdirection at entry=0) at lwutil.c:299 #2 0x00007ffef55fb5b0 in pg_parser_errhint (lwg_parser_result=lwg_parser_result at entry=0x9b3f7ff1f0) at lwgeom_pg.c:290 #3 0x00007ffef55b0cf8 in LWGEOM_in (fcinfo=0x9b3f7ff290) at lwgeom_inout.c:164 #4 0x00007ff7a5d70433 in InputFunctionCallSafe (flinfo=0x229f0959580, str=0x229f2af816d "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.46761900 46.63984000, 15.46857900 46.63916700, 15.46950600 46.63848600, 15.47039300 46.63779600, 15.4712"..., typioparam=, typmod=, escontext=0x0, result=0x229f09511c0) at fmgr.c:1607 #5 0x00007ff7a59a2070 in CopyFromTextLikeOneRow (is_csv=false, nulls=0x229f09511c8, values=, econtext=, cstate=0x229f0965c48) at copyfromparse.c:1029 #6 CopyFromTextOneRow (cstate=, econtext=, values=0x229f0951158, nulls=0x229f09511c8) at copyfromparse.c:919 #7 0x00007ff7a59a1d7b in NextCopyFrom (cstate=cstate at entry=0x229f0965c48, econtext=econtext at entry=0x229f0952fc0, values=0x229f0951158, nulls=0x229f09511c8) at copyfromparse.c:890 #8 0x00007ff7a599e78a in CopyFrom (cstate=cstate at entry=0x229f0965c48) at copyfrom.c:1149 #9 0x00007ff7a599d2be in DoCopy (pstate=0x229f08c9bd0, stmt=0x229f0949d50, stmt_location=0, stmt_len=183, processed=0x9b3f7ff6e8) at copy.c:306 #10 0x00007ff7a5c1ea0e in standard_ProcessUtility (pstmt=0x229f0949e20, queryString=0x229f0948d60 "COPY foo.gf_active_play_area (objectid,ap_id,play_id,playname,basin_id,basin_name,description,playbasin_name,age_base_ma,age_base_name,age_top_ma,age_top_name,mapped,shape) FROM STDIN;", readOnlyTree=, context=PROCESS_UTILITY_TOPLEVEL, params=0x0, queryEnv=0x0, dest=0x229f094a1e0, qc=0x9b3f7ff9a0) at utility.c:738 #11 0x00007ff7a5c1c79b in PortalRunUtility (portal=portal at entry=0x229f0912c80, pstmt=pstmt at entry=0x229f0949e20, isTopLevel=isTopLevel at entry=true, setHoldSnapshot=setHoldSnapshot at entry=false, dest=0x229f094a1e0, qc=0x9b3f7ff9a0) at pquery.c:1153 #12 0x00007ff7a5c1c8f7 in PortalRunMulti (portal=portal at entry=0x229f0912c80, isTopLevel=isTopLevel at entry=true, setHoldSnapshot=setHoldSnapshot at entry=false, dest=dest at entry=0x229f094a1e0, altdest=altdest at entry=0x229f094a1e0, qc=qc at entry=0x9b3f7ff9a0) at pquery.c:1317 #13 0x00007ff7a5c1cf8f in PortalRun (portal=portal at entry=0x229f0912c80, count=count at entry=2147483647, isTopLevel=isTopLevel at entry=true, dest=dest at entry=0x229f094a1e0, altdest=altdest at entry=0x229f094a1e0, qc=qc at entry=0x9b3f7ff9a0) at pquery.c:788 #14 0x00007ff7a5c14b91 in exec_simple_query ( query_string=0x229f0948d60 "COPY foo.gf_active_play_area (objectid,ap_id,play_id,playname,basin_id,basin_name,description,playbasin_name,age_base_ma,age_base_name,age_top_ma,age_top_name,mapped,shape) FROM STDIN;") at postgres.c:1273 #15 0x00007ff7a5c19f77 in PostgresMain (dbname=0x229f08c5b10 "crashdb", username=0x229f0556778 "postgres") at postgres.c:4766 #16 0x00007ff7a5c10be9 in BackendMain (startup_data=, startup_data_len=) at backend_startup.c:124 #17 0x00007ff7a5b5f346 in SubPostmasterMain (argc=argc at entry=3, argv=argv at entry=0x229f0551980) at launch_backend.c:713 #18 0x00007ff7a5e3d32d in main (argc=3, argv=0x229f0551980) at main.c:214 }}} -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 08:45:13 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 15:45:13 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.bf38ddda0f1335befc59ec5b25a98500@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Hello. As I understand the situation the extraction did not go as expected and something broke geometry. So we should basically look into this direction. It's a bit odd that the data set does not crash at Paul's because as I said before it crashes all the clusters I tried at all the times. -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 09:10:44 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 16:10:44 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.01a711e621490d990c6bc651b99ebd9c@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): Have confirmed that the crash behaviour starts with this Postgres commit https://github.com/postgres/postgres/commit/b7b27eb41a5cc0b45a1a9ce5c1cde5883d7bc358 -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 11:51:40 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 18:51:40 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.f2c7001ed355fe44599efb639cb582e1@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * component: postgis => topology -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 14:16:17 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:16:17 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.872472de1744e69741f54c8dc69d9880@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): I confirm the crash with procedure in comment:3 and noticed that omitting the INSERT (ie: only calling the toTopoGeom select) does not trigger the crash. Dropping all triggers doesn't help instead. -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 14:23:06 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:23:06 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.71735a82755060f406c1480155ce8142@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Another observation. By adding a second TopoGeometry column of type puntual: 1. You can get the crash ALSO when adding/inserting a POINT TopoGeometry 2. If you try to insert a POINT geometry into the LINEAL column you still get the WARNINGs but not the final crash (violation of check constraint prevents the crash) {{{ WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: TupleDesc 0x7fae0bf25590 (17671,-1) WARNING: resource was not closed: TupleDesc 0x7fae0bf103c8 (17681,-1) ERROR: new row for relation "t5118f" violates check constraint "check_topogeom_g" }}} I've to say this all sounds to me like a bug in PostgreSQL, not PostGIS. -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 14:39:07 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:39:07 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-436-g0f7d3d562 Message-ID: <20260408213907.6862719F632@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d (commit) from 2c9277d3da0794f44dee60107d107cfd9939edeb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d Author: Paul Ramsey Date: Wed Apr 8 14:36:49 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that doesn't construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index cc3ea6800..e10d60bf9 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } diff --git a/regress/core/knn_recheck.sql b/regress/core/knn_recheck.sql index f08b7f0d6..45278b7fc 100644 --- a/regress/core/knn_recheck.sql +++ b/regress/core/knn_recheck.sql @@ -239,3 +239,31 @@ SET enable_seqscan = false; SELECT '#5782', l FROM t5782 ORDER BY g <-> 'POINT(18.006691126034692 69.04048768506776)'::geometry; DROP TABLE t5782; SET enable_seqscan to default; + +-- +-- https://trac.osgeo.org/postgis/ticket/6026 +-- +CREATE TABLE reproduce_6026 ( + id SERIAL PRIMARY KEY, + geometry GEOMETRY(POLYGON, 28992) +); +INSERT INTO reproduce_6026 (geometry) VALUES + (ST_GeomFromText('POLYGON ((133894.531 490000, 132700 490000, 132460 490000, 131703.958 489011.71, 131695 489000, 132880 489000, 132880 488416.725, 133206.605 488583.011, 134029.81 489022.36, 133917.695 490000, 133894.531 490000))', 28992)), + (ST_GeomFromText('POLYGON ((138000 492000, 141276.49 492000, 141050 492550, 140967.11 492751.305, 139951.651 495217.42, 139490.072 495217.42, 136358.892 495217.42, 135900 495217.42, 135301.1 495217.42, 135118.887 495296.573, 135115.873 495264.338, 135106.301 495164.456, 135098.485 495065.802, 135090.476 494967.014, 135085.764 494917.296, 135078.439 494866.459, 135070.381 494817.483, 135060.353 494767.172, 135036.351 494674.319, 135017.779 494615.505, 134991.438 494544.049, 134972.66 494501.055, 134948.148 494446.666, 134922.544 494398.914, 134872.859 494311.273, 134859.929 494292.444, 134843.402 494264.587, 134815.107 494200.454, 134770.855 494120.756, 134728.422 494053.048, 134932.74 493923.77, 133708.3 491825.92, 133917.695 490000, 134029.81 489022.36, 138000 492000))', 28992)), + (ST_GeomFromText('POLYGON ((131215.201 487105.005, 134029.81 486992.15, 134029.81 489022.36, 133206.605 488583.011, 132880 488416.725, 132198.685 488069.845, 131375.721 487651.916, 131199.012 487560.733, 131198.76 487560.603, 131215.201 487105.005))', 28992)), + (ST_GeomFromText('POLYGON ((134029.81 489022.36, 136889.1 488581.7, 138000 492000, 134029.81 489022.36))', 28992)), + (ST_GeomFromText('POLYGON ((133917.695 490000, 133708.3 491825.92, 133541.312 491951.805, 133460 491840, 132820 491000, 132210 490190, 132460 490000, 132700 490000, 133894.531 490000, 133917.695 490000))', 28992)); + +-- create index +CREATE INDEX reproduce_6026_x +ON reproduce_6026 USING GIST(geometry); +-- force index usage +SET enable_seqscan = OFF; +-- Reproduce error +SELECT '#6026', id + FROM reproduce_6026 + ORDER BY geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992) + LIMIT 4; + +DROP TABLE reproduce_6026; + diff --git a/regress/core/knn_recheck_expected b/regress/core/knn_recheck_expected index 226f99ed7..051131700 100644 --- a/regress/core/knn_recheck_expected +++ b/regress/core/knn_recheck_expected @@ -107,3 +107,7 @@ #3418|0.5500000|0.5500000 #5782|A #5782|B +#6026|1 +#6026|2 +#6026|3 +#6026|4 ----------------------------------------------------------------------- Summary of changes: liblwgeom/measures.c | 176 +++++++++++++++++++++++++------------- regress/core/knn_recheck.sql | 28 ++++++ regress/core/knn_recheck_expected | 4 + 3 files changed, 147 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:39:18 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:39:18 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.0979fd2b0ac0707f82914464e57963e2@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d/git" 0f7d3d5/git]: {{{#!CommitTicketReference repository="git" revision="0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that doesn't construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 14:43:03 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:43:03 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-13-ge91db587b Message-ID: <20260408214303.92EA819F9EC@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.6 has been updated via e91db587b9ec8dcb4cbea6faa48e2b92be100290 (commit) from b25865df6950e117a859324e9d570de4b2292df6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e91db587b9ec8dcb4cbea6faa48e2b92be100290 Author: Paul Ramsey Date: Wed Apr 8 14:42:25 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 5078062b0..7deb40571 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ topogeometry corruption: - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - +- #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.6.2 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index cc3ea6800..458e82978 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,106 +2206,161 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } + /** Compares incoming points and stores the points closest to each other or most far away from each other depending on * dl->mode (max or min) */ int ----------------------------------------------------------------------- Summary of changes: NEWS | 2 +- liblwgeom/measures.c | 177 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 62 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:43:09 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:43:09 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.db151dfd206a24f88820ca1acf72bba0@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"e91db587b9ec8dcb4cbea6faa48e2b92be100290/git" e91db58/git]: {{{#!CommitTicketReference repository="git" revision="e91db587b9ec8dcb4cbea6faa48e2b92be100290" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 14:44:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:44:45 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-12-ge880eb837 Message-ID: <20260408214445.EC281138388@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.5 has been updated via e880eb8371ee31ada8b11c0fa580b08f1d4dc806 (commit) from cb5334b7c736f9edc1e6e124d4688300111ab397 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e880eb8371ee31ada8b11c0fa580b08f1d4dc806 Author: Paul Ramsey Date: Wed Apr 8 14:44:37 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 58e7e8bf4..a75a2f7c6 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.5.5 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index b96e7bf62..6e13442cc 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 176 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 116 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:44:47 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:44:47 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.1a4b0d5913dcd9267017a435259b837f@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"e880eb8371ee31ada8b11c0fa580b08f1d4dc806/git" e880eb8/git]: {{{#!CommitTicketReference repository="git" revision="e880eb8371ee31ada8b11c0fa580b08f1d4dc806" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 14:46:40 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:46:40 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-14-gabdf9e9b7 Message-ID: <20260408214640.79164138184@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.4 has been updated via abdf9e9b713aee3741deb946330dbf2c802692db (commit) from 9441c6b61df7799408119c3f2c912740a80405d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit abdf9e9b713aee3741deb946330dbf2c802692db Author: Paul Ramsey Date: Wed Apr 8 14:46:29 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 941b52c53..7ead93205 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Proj 6.1+ required. and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.4.5 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index 613a217bf..d2f7b9783 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertexes, compared to mindistance which can be between two vertexes.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 176 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 116 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:46:41 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:46:41 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.08b5bc255d1b3eefdaaebb0380aca42f@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"abdf9e9b713aee3741deb946330dbf2c802692db/git" abdf9e9/git]: {{{#!CommitTicketReference repository="git" revision="abdf9e9b713aee3741deb946330dbf2c802692db" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: 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. From git at osgeo.org Wed Apr 8 14:48:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:48:01 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-12-gb1e96843c Message-ID: <20260408214801.A495F138288@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.3 has been updated via b1e96843c5aebc7effb907fbe9ee3c815447a40f (commit) from 9abdb5153690679b44cced668ba32c9cba833dc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b1e96843c5aebc7effb907fbe9ee3c815447a40f Author: Paul Ramsey Date: Wed Apr 8 14:47:46 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index afccd4faf..cb3aec833 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PostGIS 3.3.10 and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.3.9 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index 2fd217e90..2774b38c0 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2216,106 +2216,161 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertexes, compared to mindistance which can be between two vertexes.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } + /** Compares incoming points and stores the points closest to each other or most far away from each other depending on * dl->mode (max or min) */ int ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 177 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:48:03 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:48:03 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.29e285b56b115a8179453dbffdd50666@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"b1e96843c5aebc7effb907fbe9ee3c815447a40f/git" b1e9684/git]: {{{#!CommitTicketReference repository="git" revision="b1e96843c5aebc7effb907fbe9ee3c815447a40f" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 14:48:14 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:48:14 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.1f86b9e50478e4c62ff790367b6dd560@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: fixed | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 15:19:13 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 22:19:13 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.32eaa04ac656a980eff9c9e7a7e4fb73@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): Pretty sure I see the issue, which I am surprised never showed up before? 20 years in? But the parser is returning a error location of 1131025 when the WKT input is only 1047553 bytes long. This rather screws up the logic in lwmessage_truncate, I think. I will have to see if I can generate this organically on smaller inputs. One task is just to make lwmessage_truncate more robust. Another is to explore why the error location is 10% too large. -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 15:21:24 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 22:21:24 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.33d1e8b5207c026d03c9ea668dd82ced@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): (The WKT is truly incorrect though, it is truncated, so something in your Oracle conversion process is trimming it, and your data load would have failed, had we not, er... crashed.) {{{ cat gf_active_play_area.sql | grep "15.46475600 46.64170500" }}} -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 16:29:16 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 23:29:16 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.6acd4e7bfd53c7d2816cb9dc4d555213@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): > I've to say this all sounds to me like a bug in PostgreSQL, not PostGIS. Yah sounds like it. We don't even have an C code behind toTopogeom, it's all plpgsql so can't see how we could have screwed that up. I'll see if I can create an example that doesn't involve postgis to trigger the bug and bounce it back to the PostgreSQL court if I can. -- Ticket URL: 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. From trac at osgeo.org Wed Apr 8 16:29:29 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 23:29:29 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.cf0a4b71083dcf15eb3036b0828e3dbf@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * owner: strk => robe * status: assigned => new -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 02:17:16 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 09:17:16 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.9a643bc50ba4297846fb6e0a2b0cfe61@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Well, toTopoGeom calls into C functions, so it's not purely plpgsql. Adding NOTICE prints in the C function (TopoGeo_AddPoint, which is the smallest) I see the warnings and the crash happen after `SPI_finish`: {{{ BEGIN NOTICE: Before SPI finish NOTICE: After SPI finish WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: TupleDesc 0x7f26697ec598 (17671,-1) WARNING: resource was not closed: TupleDesc 0x7f26697d63f0 (17681,-1) server closed the connection unexpectedly }}} -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 02:18:23 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 09:18:23 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.95492305acc1b9fb0ab9b4a25a633346@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Also: skipping SPI completely avoids the crash, so this seems to be SPI related -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 08:35:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 15:35:21 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.7d1b2b20e08c8e0a20d1d3e0959f546b@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): For reference, link to message Sandro sent to hackers - https://www.postgresql.org/message-id/adeIhgpWq22E5kwW%40hst.kbt.io -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 09:03:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 16:03:21 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.90c341f792e2308a97817450fbad2b48@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+-------------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS PostgreSQL Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------------------- Changes (by strk): * milestone: PostGIS 3.6.2 => PostGIS PostgreSQL -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 09:03:49 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 16:03:49 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.231cf6c1d9738a6e46c8fb1908f142eb@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Thanks a lot for the support, I will try to look into the trimming issue. So far, I can see that SDE.ST_ASTEXT does not truncate this geometry, so most likely this happens in ora2pg. Do you need any other help from me? -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 09:45:00 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 09:45:00 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-437-gee5c80269 Message-ID: <20260409164500.D224D16E66A@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via ee5c8026941e2920c2b1ca4f4edd6177b06864a2 (commit) from 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ee5c8026941e2920c2b1ca4f4edd6177b06864a2 Author: Sandro Santilli Date: Thu Apr 9 18:44:42 2026 +0200 Ignore build dir during spell checking diff --git a/.codespellrc b/.codespellrc index 82f0b40c0..5fea525d5 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,7 @@ [codespell] ignore-words = .codespell.ignore skip = + ./build/**, ./deps/**, ./extensions/*/sql/**, ./extensions/*/sql_bits/*.sql, ----------------------------------------------------------------------- Summary of changes: .codespellrc | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 11:02:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 11:02:56 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-438-g593e1f084 Message-ID: <20260409180256.5F23216F61C@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e (commit) from ee5c8026941e2920c2b1ca4f4edd6177b06864a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e Author: Sandro Santilli Date: Thu Apr 9 20:01:59 2026 +0200 Drop left-over debug lines from test diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index f54145537..04b63f2e9 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -643,13 +643,11 @@ SELECT 't6064.1', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', )'); SELECT 't6064.check.intermediate', * FROM topology.ValidateTopology('t6064'); -set client_min_messages to DEBUG; SELECT 't6064.2', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', 'LINESTRING( 17.42207545158653 69.11091383590062, 17.42207570266477 69.11091383235974, 17.622976580401076 69.12848944101118 )'); -set client_min_messages to WARNING; SELECT 't6064.check.final', * FROM topology.ValidateTopology('t6064'); SELECT NULL FROM topology.DropTopology ('t6064'); ----------------------------------------------------------------------- Summary of changes: topology/test/regress/topogeo_addlinestring.sql | 2 -- 1 file changed, 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 14:56:31 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:56:31 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-14-gbf475b549 Message-ID: <20260409215631.EF53B18048C@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.6 has been updated via bf475b54959c3605055e783496f3d8474d696e9e (commit) from e91db587b9ec8dcb4cbea6faa48e2b92be100290 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bf475b54959c3605055e783496f3d8474d696e9e Author: Paul Ramsey Date: Thu Apr 9 14:55:38 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 7deb40571..1d69eb34d 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ topogeometry corruption: - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) +- #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.6.2 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..ad0dad519 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -276,6 +276,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:56:41 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:56:41 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.62060acb6b02a2be2e5c3064a446eaa0@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"bf475b54959c3605055e783496f3d8474d696e9e/git" bf475b54/git]: {{{#!CommitTicketReference repository="git" revision="bf475b54959c3605055e783496f3d8474d696e9e" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 14:57:49 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:57:49 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-13-g5c1ed575d Message-ID: <20260409215749.568B218058B@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.5 has been updated via 5c1ed575d82b33355f2ed338e5c41c30e99d2f48 (commit) from e880eb8371ee31ada8b11c0fa580b08f1d4dc806 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5c1ed575d82b33355f2ed338e5c41c30e99d2f48 Author: Paul Ramsey Date: Thu Apr 9 14:57:33 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index a75a2f7c6..23a96792c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.5.5 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..ad0dad519 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -276,6 +276,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:57:50 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:57:50 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.08ec7cf25cae7d9ac006b5a887b54db1@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"5c1ed575d82b33355f2ed338e5c41c30e99d2f48/git" 5c1ed575/git]: {{{#!CommitTicketReference repository="git" revision="5c1ed575d82b33355f2ed338e5c41c30e99d2f48" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 14:59:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:59:16 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-15-ga94af5771 Message-ID: <20260409215916.DABD9180236@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.4 has been updated via a94af577180ed222ec217a20c4330713b40936ce (commit) from abdf9e9b713aee3741deb946330dbf2c802692db (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a94af577180ed222ec217a20c4330713b40936ce Author: Paul Ramsey Date: Thu Apr 9 14:59:02 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 7ead93205..dce1d6bfe 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Proj 6.1+ required. - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.4.5 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..0ba962865 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, + 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, - 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, - 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, - 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,44 +678,42 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[53] = +static const YY_CHAR yy_meta[36] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 + 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, - 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, - 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, - 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, - 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, - 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, - 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, - 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, - 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, - 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, + 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, + 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, + 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, + 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, + 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, + 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, + 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, + 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, + 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, + 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, - 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, - 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, - 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, - 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, - 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, - 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, - 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, - 342, 351, 347, 391, 391, 391 + 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, + 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, + 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, + 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, + 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, + 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, + 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, + 67, 54, 39, 221, 221, 221 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -734,110 +732,68 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[444] = +static const flex_int16_t yy_nxt[257] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, - 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, - 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, - 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, + 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, + 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, + 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, + 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, + 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, + 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, + 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, - 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, - 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, - 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, - 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, - 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, - 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, - 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, - 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, - 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, - 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, + 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, + 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, + 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, - 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, - 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, - 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, - 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, - 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, - 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, - 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, - 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, - 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, - 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, - - 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, - 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, - 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, - 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, - 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, - 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, - 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, - 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, - 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, + 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, + 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; -static const flex_int16_t yy_chk[444] = +static const flex_int16_t yy_chk[257] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, - 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, - 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, + 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, + 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, + 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, + 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, + 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, + 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, + 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, - 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, - 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, - 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, - 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, - 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, - 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, - 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, - 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, - 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, - 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, - - 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, - 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, - 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, - 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, - 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, - 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, - 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, - 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, - 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, - 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, - - 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, - 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, - 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, - 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, - 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, - 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, - 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, - 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, - 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, + 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, + 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, + 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, + 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, + 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, + 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, + 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, + 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -903,10 +859,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 906 "lwin_wkt_lex.c" +#line 862 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 909 "lwin_wkt_lex.c" +#line 865 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1124,7 +1080,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1127 "lwin_wkt_lex.c" +#line 1083 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1179,29 +1135,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1172,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1261,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1296,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1302 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2245,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 260 ++++++++++++++++++++--------------------------- liblwgeom/lwin_wkt_lex.l | 6 +- liblwgeom/lwutil.c | 4 + 4 files changed, 118 insertions(+), 153 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:59:18 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:59:18 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.f3074f5a9b02688dfa3c9c6f0a39006d@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"a94af577180ed222ec217a20c4330713b40936ce/git" a94af57/git]: {{{#!CommitTicketReference repository="git" revision="a94af577180ed222ec217a20c4330713b40936ce" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 15:00:33 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:00:33 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-13-g1e9706654 Message-ID: <20260409220033.47144180428@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.3 has been updated via 1e9706654e856e794701d7573e448986944956e5 (commit) from b1e96843c5aebc7effb907fbe9ee3c815447a40f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1e9706654e856e794701d7573e448986944956e5 Author: Paul Ramsey Date: Thu Apr 9 15:00:17 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index cb3aec833..bf3150120 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ PostGIS 3.3.10 - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.3.9 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:00:35 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:00:35 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.21ab9e777361ad9e8ae4e654c099195f@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"1e9706654e856e794701d7573e448986944956e5/git" 1e97066/git]: {{{#!CommitTicketReference repository="git" revision="1e9706654e856e794701d7573e448986944956e5" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 15:01:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:01:41 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-7-gd491e6a68 Message-ID: <20260409220141.A4A9918043A@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.2 has been updated via d491e6a68b19b3a049f72fb5e3b6b9f007e04295 (commit) from 458f750305a0986d7aac6ab47d4a6fa576d153eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d491e6a68b19b3a049f72fb5e3b6b9f007e04295 Author: Paul Ramsey Date: Thu Apr 9 15:01:30 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 5c95631e9..556664e47 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Proj 4.9+ required. - #6054, Remove priv escalation scenario. Reported by Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.2.9 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..0ba962865 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, + 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, - 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, - 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, - 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,44 +678,42 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[53] = +static const YY_CHAR yy_meta[36] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 + 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, - 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, - 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, - 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, - 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, - 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, - 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, - 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, - 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, - 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, + 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, + 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, + 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, + 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, + 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, + 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, + 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, + 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, + 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, + 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, - 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, - 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, - 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, - 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, - 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, - 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, - 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, - 342, 351, 347, 391, 391, 391 + 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, + 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, + 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, + 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, + 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, + 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, + 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, + 67, 54, 39, 221, 221, 221 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -734,110 +732,68 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[444] = +static const flex_int16_t yy_nxt[257] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, - 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, - 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, - 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, + 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, + 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, + 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, + 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, + 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, + 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, + 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, - 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, - 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, - 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, - 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, - 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, - 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, - 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, - 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, - 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, - 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, + 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, + 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, + 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, - 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, - 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, - 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, - 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, - 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, - 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, - 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, - 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, - 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, - 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, - - 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, - 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, - 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, - 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, - 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, - 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, - 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, - 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, - 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, + 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, + 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; -static const flex_int16_t yy_chk[444] = +static const flex_int16_t yy_chk[257] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, - 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, - 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, + 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, + 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, + 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, + 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, + 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, + 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, + 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, - 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, - 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, - 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, - 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, - 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, - 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, - 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, - 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, - 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, - 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, - - 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, - 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, - 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, - 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, - 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, - 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, - 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, - 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, - 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, - 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, - - 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, - 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, - 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, - 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, - 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, - 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, - 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, - 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, - 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, + 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, + 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, + 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, + 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, + 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, + 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, + 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, + 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -903,10 +859,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 906 "lwin_wkt_lex.c" +#line 862 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 909 "lwin_wkt_lex.c" +#line 865 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1124,7 +1080,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1127 "lwin_wkt_lex.c" +#line 1083 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1179,29 +1135,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1172,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1261,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1296,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1302 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2245,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 260 ++++++++++++++++++++--------------------------- liblwgeom/lwin_wkt_lex.l | 6 +- liblwgeom/lwutil.c | 4 + 4 files changed, 118 insertions(+), 153 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:01:43 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:01:43 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.8c1209dcfeaf9041400903db207b2619@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"d491e6a68b19b3a049f72fb5e3b6b9f007e04295/git" d491e6a6/git]: {{{#!CommitTicketReference repository="git" revision="d491e6a68b19b3a049f72fb5e3b6b9f007e04295" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 15:04:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:04:16 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-439-g6f3355d3a Message-ID: <20260409220416.A65721800BF@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, master has been updated via 6f3355d3a1046c5f1af80e499cbad6f4f438dd9d (commit) from 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6f3355d3a1046c5f1af80e499cbad6f4f438dd9d Author: Paul Ramsey Date: Thu Apr 9 15:03:52 2026 -0700 Rework the WKT parser position counter, which was dramatically over counting the parse position, resulting in bad memory accesses for long enough inputs with errors near the ends. References #6061 diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 011efab70..b9081db9c 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -2296,7 +2296,7 @@ extern char* hexbytes_from_bytes(const uint8_t *bytes, size_t size); /* * WKT detailed parsing support */ -extern int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags); +extern int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parse_flags); void lwgeom_parser_result_init(LWGEOM_PARSER_RESULT *parser_result); void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result); @@ -2307,7 +2307,7 @@ extern void *lwrealloc(void *mem, size_t size); extern void lwfree(void *mem); /* Utilities */ -extern char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection); +extern char *lwmessage_truncate(const char *str, int errpos, int maxlength); /* * TWKB functions diff --git a/liblwgeom/lwin_wkt.c b/liblwgeom/lwin_wkt.c index c9a1bde25..174388d84 100644 --- a/liblwgeom/lwin_wkt.c +++ b/liblwgeom/lwin_wkt.c @@ -941,7 +941,7 @@ LWGEOM *lwgeom_from_wkt(const char *wkt, const char check) { LWGEOM_PARSER_RESULT r; - if( LW_FAILURE == lwgeom_parse_wkt(&r, (char*)wkt, check) ) + if( LW_FAILURE == lwgeom_parse_wkt(&r, wkt, check) ) { lwerror("%s", r.message); return NULL; diff --git a/liblwgeom/lwin_wkt.h b/liblwgeom/lwin_wkt.h index b0165a573..11369e12e 100644 --- a/liblwgeom/lwin_wkt.h +++ b/liblwgeom/lwin_wkt.h @@ -48,7 +48,7 @@ extern const char *parser_error_messages[]; /* * Prototypes for the lexer */ -extern void wkt_lexer_init(char *str); +extern void wkt_lexer_init(const char *str); extern void wkt_lexer_close(void); extern int wkt_yylex_destroy(void); diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..bea50e86e 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) @@ -2304,7 +2310,7 @@ void wkt_yyfree (void * ptr ) /* * Set up the lexer! */ -void wkt_lexer_init(char *src) +void wkt_lexer_init(const char *src) { yy_init_globals(); wkt_yy_buf_state = wkt_yy_scan_string(src); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..10b444d12 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } @@ -135,7 +133,7 @@ void wkt_yyfree (void * ptr ) /* * Set up the lexer! */ -void wkt_lexer_init(char *src) +void wkt_lexer_init(const char *src) { yy_init_globals(); wkt_yy_buf_state = wkt_yy_scan_string(src); diff --git a/liblwgeom/lwin_wkt_parse.c b/liblwgeom/lwin_wkt_parse.c index b921af6e6..142e4f2d8 100644 --- a/liblwgeom/lwin_wkt_parse.c +++ b/liblwgeom/lwin_wkt_parse.c @@ -123,7 +123,7 @@ void wkt_yyerror(__attribute__((__unused__)) const char *str) * (eg, from within other functions in lwin_wkt.c) or from a threaded program. * Note that parser_result.wkinput picks up a reference to wktstr. */ -int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags) +int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parser_check_flags) { int parse_rv = 0; @@ -474,7 +474,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if 1 +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -539,7 +539,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* 1 */ +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -668,27 +668,27 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 217, 217, 219, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 240, - 242, 244, 246, 250, 252, 256, 258, 260, 262, 266, - 268, 270, 272, 274, 276, 280, 282, 284, 286, 290, - 292, 294, 296, 300, 302, 304, 306, 310, 312, 316, - 318, 322, 324, 326, 328, 332, 334, 338, 341, 343, - 345, 347, 351, 353, 357, 358, 359, 360, 363, 365, - 369, 371, 375, 378, 381, 383, 385, 387, 391, 393, - 395, 397, 399, 401, 405, 407, 409, 411, 415, 417, - 419, 421, 423, 425, 427, 429, 433, 435, 437, 439, - 443, 445, 449, 451, 453, 455, 459, 461, 463, 465, - 469, 471, 475, 477, 481, 483, 485, 487, 491, 495, - 497, 499, 501, 505, 507, 511, 513, 515, 519, 521, - 523, 525, 529, 531, 535, 537, 539 + 0, 216, 216, 218, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 239, + 241, 243, 245, 249, 251, 255, 257, 259, 261, 265, + 267, 269, 271, 273, 275, 279, 281, 283, 285, 289, + 291, 293, 295, 299, 301, 303, 305, 309, 311, 315, + 317, 321, 323, 325, 327, 331, 333, 337, 340, 342, + 344, 346, 350, 352, 356, 357, 358, 359, 362, 364, + 368, 370, 374, 377, 380, 382, 384, 386, 390, 392, + 394, 396, 398, 400, 404, 406, 408, 410, 414, 416, + 418, 420, 422, 424, 426, 428, 432, 434, 436, 438, + 442, 444, 448, 450, 452, 454, 458, 460, 462, 464, + 468, 470, 474, 476, 480, 482, 484, 486, 490, 494, + 496, 498, 500, 504, 506, 510, 512, 514, 518, 520, + 522, 524, 528, 530, 534, 536, 538 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) -#if 1 +#if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; @@ -1227,278 +1227,10 @@ int yydebug; #endif -/* Context of a parse error. */ -typedef struct -{ - yy_state_t *yyssp; - yysymbol_kind_t yytoken; - YYLTYPE *yylloc; -} yypcontext_t; - -/* Put in YYARG at most YYARGN of the expected tokens given the - current YYCTX, and return the number of tokens stored in YYARG. If - YYARG is null, return the number of expected tokens (guaranteed to - be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. - Return 0 if there are more than YYARGN expected tokens, yet fill - YYARG up to YYARGN. */ -static int -yypcontext_expected_tokens (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); - } - } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; -} -#ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -yystrlen (const char *yystr) -{ - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -#endif - -#ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (yyres) - return yystpcpy (yyres, yystr) - yyres; - else - return yystrlen (yystr); -} -#endif - - -static int -yy_syntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yyctx->yytoken != YYSYMBOL_YYEMPTY) - { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens (yyctx, - yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; - } - return yycount; -} - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - const yypcontext_t *yyctx) -{ - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; - - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen (yyformat) - 2 * yycount + 1; - { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); - yyformat += 2; - } - else - { - ++yyp; - ++yyformat; - } - } - return 0; -} - - /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ @@ -1517,225 +1249,225 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_geometry_no_srid: /* geometry_no_srid */ -#line 194 "lwin_wkt_parse.y" +#line 193 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1523 "lwin_wkt_parse.c" +#line 1255 "lwin_wkt_parse.c" break; case YYSYMBOL_geometrycollection: /* geometrycollection */ -#line 195 "lwin_wkt_parse.y" +#line 194 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1529 "lwin_wkt_parse.c" +#line 1261 "lwin_wkt_parse.c" break; case YYSYMBOL_geometry_list: /* geometry_list */ -#line 196 "lwin_wkt_parse.y" +#line 195 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1535 "lwin_wkt_parse.c" +#line 1267 "lwin_wkt_parse.c" break; case YYSYMBOL_multisurface: /* multisurface */ -#line 203 "lwin_wkt_parse.y" +#line 202 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1541 "lwin_wkt_parse.c" +#line 1273 "lwin_wkt_parse.c" break; case YYSYMBOL_surface_list: /* surface_list */ -#line 181 "lwin_wkt_parse.y" +#line 180 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1547 "lwin_wkt_parse.c" +#line 1279 "lwin_wkt_parse.c" break; case YYSYMBOL_tin: /* tin */ -#line 210 "lwin_wkt_parse.y" +#line 209 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1553 "lwin_wkt_parse.c" +#line 1285 "lwin_wkt_parse.c" break; case YYSYMBOL_polyhedralsurface: /* polyhedralsurface */ -#line 209 "lwin_wkt_parse.y" +#line 208 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1559 "lwin_wkt_parse.c" +#line 1291 "lwin_wkt_parse.c" break; case YYSYMBOL_multipolygon: /* multipolygon */ -#line 202 "lwin_wkt_parse.y" +#line 201 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1565 "lwin_wkt_parse.c" +#line 1297 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon_list: /* polygon_list */ -#line 182 "lwin_wkt_parse.y" +#line 181 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1571 "lwin_wkt_parse.c" +#line 1303 "lwin_wkt_parse.c" break; case YYSYMBOL_patch_list: /* patch_list */ -#line 183 "lwin_wkt_parse.y" +#line 182 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1577 "lwin_wkt_parse.c" +#line 1309 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon: /* polygon */ -#line 206 "lwin_wkt_parse.y" +#line 205 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1583 "lwin_wkt_parse.c" +#line 1315 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon_untagged: /* polygon_untagged */ -#line 208 "lwin_wkt_parse.y" +#line 207 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1589 "lwin_wkt_parse.c" +#line 1321 "lwin_wkt_parse.c" break; case YYSYMBOL_patch: /* patch */ -#line 207 "lwin_wkt_parse.y" +#line 206 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1595 "lwin_wkt_parse.c" +#line 1327 "lwin_wkt_parse.c" break; case YYSYMBOL_curvepolygon: /* curvepolygon */ -#line 192 "lwin_wkt_parse.y" +#line 191 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1601 "lwin_wkt_parse.c" +#line 1333 "lwin_wkt_parse.c" break; case YYSYMBOL_curvering_list: /* curvering_list */ -#line 179 "lwin_wkt_parse.y" +#line 178 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1607 "lwin_wkt_parse.c" +#line 1339 "lwin_wkt_parse.c" break; case YYSYMBOL_curvering: /* curvering */ -#line 193 "lwin_wkt_parse.y" +#line 192 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1613 "lwin_wkt_parse.c" +#line 1345 "lwin_wkt_parse.c" break; case YYSYMBOL_patchring_list: /* patchring_list */ -#line 189 "lwin_wkt_parse.y" +#line 188 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1619 "lwin_wkt_parse.c" +#line 1351 "lwin_wkt_parse.c" break; case YYSYMBOL_ring_list: /* ring_list */ -#line 188 "lwin_wkt_parse.y" +#line 187 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1625 "lwin_wkt_parse.c" +#line 1357 "lwin_wkt_parse.c" break; case YYSYMBOL_patchring: /* patchring */ -#line 178 "lwin_wkt_parse.y" +#line 177 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1631 "lwin_wkt_parse.c" +#line 1363 "lwin_wkt_parse.c" break; case YYSYMBOL_ring: /* ring */ -#line 177 "lwin_wkt_parse.y" +#line 176 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1637 "lwin_wkt_parse.c" +#line 1369 "lwin_wkt_parse.c" break; case YYSYMBOL_compoundcurve: /* compoundcurve */ -#line 191 "lwin_wkt_parse.y" +#line 190 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1643 "lwin_wkt_parse.c" +#line 1375 "lwin_wkt_parse.c" break; case YYSYMBOL_compound_list: /* compound_list */ -#line 187 "lwin_wkt_parse.y" +#line 186 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1649 "lwin_wkt_parse.c" +#line 1381 "lwin_wkt_parse.c" break; case YYSYMBOL_multicurve: /* multicurve */ -#line 199 "lwin_wkt_parse.y" +#line 198 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1655 "lwin_wkt_parse.c" +#line 1387 "lwin_wkt_parse.c" break; case YYSYMBOL_curve_list: /* curve_list */ -#line 186 "lwin_wkt_parse.y" +#line 185 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1661 "lwin_wkt_parse.c" +#line 1393 "lwin_wkt_parse.c" break; case YYSYMBOL_multilinestring: /* multilinestring */ -#line 200 "lwin_wkt_parse.y" +#line 199 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1667 "lwin_wkt_parse.c" +#line 1399 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring_list: /* linestring_list */ -#line 185 "lwin_wkt_parse.y" +#line 184 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1673 "lwin_wkt_parse.c" +#line 1405 "lwin_wkt_parse.c" break; case YYSYMBOL_circularstring: /* circularstring */ -#line 190 "lwin_wkt_parse.y" +#line 189 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1679 "lwin_wkt_parse.c" +#line 1411 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring: /* linestring */ -#line 197 "lwin_wkt_parse.y" +#line 196 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1685 "lwin_wkt_parse.c" +#line 1417 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring_untagged: /* linestring_untagged */ -#line 198 "lwin_wkt_parse.y" +#line 197 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1691 "lwin_wkt_parse.c" +#line 1423 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle_list: /* triangle_list */ -#line 180 "lwin_wkt_parse.y" +#line 179 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1697 "lwin_wkt_parse.c" +#line 1429 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle: /* triangle */ -#line 211 "lwin_wkt_parse.y" +#line 210 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1703 "lwin_wkt_parse.c" +#line 1435 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle_untagged: /* triangle_untagged */ -#line 212 "lwin_wkt_parse.y" +#line 211 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1709 "lwin_wkt_parse.c" +#line 1441 "lwin_wkt_parse.c" break; case YYSYMBOL_multipoint: /* multipoint */ -#line 201 "lwin_wkt_parse.y" +#line 200 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1715 "lwin_wkt_parse.c" +#line 1447 "lwin_wkt_parse.c" break; case YYSYMBOL_point_list: /* point_list */ -#line 184 "lwin_wkt_parse.y" +#line 183 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1721 "lwin_wkt_parse.c" +#line 1453 "lwin_wkt_parse.c" break; case YYSYMBOL_point_untagged: /* point_untagged */ -#line 205 "lwin_wkt_parse.y" +#line 204 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1727 "lwin_wkt_parse.c" +#line 1459 "lwin_wkt_parse.c" break; case YYSYMBOL_point: /* point */ -#line 204 "lwin_wkt_parse.y" +#line 203 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1733 "lwin_wkt_parse.c" +#line 1465 "lwin_wkt_parse.c" break; case YYSYMBOL_ptarray: /* ptarray */ -#line 176 "lwin_wkt_parse.y" +#line 175 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1739 "lwin_wkt_parse.c" +#line 1471 "lwin_wkt_parse.c" break; default: @@ -1807,10 +1539,7 @@ yyparse (void) /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) @@ -2031,817 +1760,817 @@ yyreduce: switch (yyn) { case 2: /* geometry: geometry_no_srid */ -#line 218 "lwin_wkt_parse.y" +#line 217 "lwin_wkt_parse.y" { wkt_parser_geometry_new((yyvsp[0].geometryvalue), SRID_UNKNOWN); WKT_ERROR(); } -#line 2037 "lwin_wkt_parse.c" +#line 1766 "lwin_wkt_parse.c" break; case 3: /* geometry: SRID_TOK SEMICOLON_TOK geometry_no_srid */ -#line 220 "lwin_wkt_parse.y" +#line 219 "lwin_wkt_parse.y" { wkt_parser_geometry_new((yyvsp[0].geometryvalue), (yyvsp[-2].integervalue)); WKT_ERROR(); } -#line 2043 "lwin_wkt_parse.c" +#line 1772 "lwin_wkt_parse.c" break; case 4: /* geometry_no_srid: point */ -#line 223 "lwin_wkt_parse.y" +#line 222 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2049 "lwin_wkt_parse.c" +#line 1778 "lwin_wkt_parse.c" break; case 5: /* geometry_no_srid: linestring */ -#line 224 "lwin_wkt_parse.y" +#line 223 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2055 "lwin_wkt_parse.c" +#line 1784 "lwin_wkt_parse.c" break; case 6: /* geometry_no_srid: circularstring */ -#line 225 "lwin_wkt_parse.y" +#line 224 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2061 "lwin_wkt_parse.c" +#line 1790 "lwin_wkt_parse.c" break; case 7: /* geometry_no_srid: compoundcurve */ -#line 226 "lwin_wkt_parse.y" +#line 225 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2067 "lwin_wkt_parse.c" +#line 1796 "lwin_wkt_parse.c" break; case 8: /* geometry_no_srid: polygon */ -#line 227 "lwin_wkt_parse.y" +#line 226 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2073 "lwin_wkt_parse.c" +#line 1802 "lwin_wkt_parse.c" break; case 9: /* geometry_no_srid: curvepolygon */ -#line 228 "lwin_wkt_parse.y" +#line 227 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2079 "lwin_wkt_parse.c" +#line 1808 "lwin_wkt_parse.c" break; case 10: /* geometry_no_srid: multipoint */ -#line 229 "lwin_wkt_parse.y" +#line 228 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2085 "lwin_wkt_parse.c" +#line 1814 "lwin_wkt_parse.c" break; case 11: /* geometry_no_srid: multilinestring */ -#line 230 "lwin_wkt_parse.y" +#line 229 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2091 "lwin_wkt_parse.c" +#line 1820 "lwin_wkt_parse.c" break; case 12: /* geometry_no_srid: multipolygon */ -#line 231 "lwin_wkt_parse.y" +#line 230 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2097 "lwin_wkt_parse.c" +#line 1826 "lwin_wkt_parse.c" break; case 13: /* geometry_no_srid: multisurface */ -#line 232 "lwin_wkt_parse.y" +#line 231 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2103 "lwin_wkt_parse.c" +#line 1832 "lwin_wkt_parse.c" break; case 14: /* geometry_no_srid: multicurve */ -#line 233 "lwin_wkt_parse.y" +#line 232 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2109 "lwin_wkt_parse.c" +#line 1838 "lwin_wkt_parse.c" break; case 15: /* geometry_no_srid: tin */ -#line 234 "lwin_wkt_parse.y" +#line 233 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2115 "lwin_wkt_parse.c" +#line 1844 "lwin_wkt_parse.c" break; case 16: /* geometry_no_srid: polyhedralsurface */ -#line 235 "lwin_wkt_parse.y" +#line 234 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2121 "lwin_wkt_parse.c" +#line 1850 "lwin_wkt_parse.c" break; case 17: /* geometry_no_srid: triangle */ -#line 236 "lwin_wkt_parse.y" +#line 235 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2127 "lwin_wkt_parse.c" +#line 1856 "lwin_wkt_parse.c" break; case 18: /* geometry_no_srid: geometrycollection */ -#line 237 "lwin_wkt_parse.y" +#line 236 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2133 "lwin_wkt_parse.c" +#line 1862 "lwin_wkt_parse.c" break; case 19: /* geometrycollection: COLLECTION_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */ -#line 241 "lwin_wkt_parse.y" +#line 240 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2139 "lwin_wkt_parse.c" +#line 1868 "lwin_wkt_parse.c" break; case 20: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */ -#line 243 "lwin_wkt_parse.y" +#line 242 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2145 "lwin_wkt_parse.c" +#line 1874 "lwin_wkt_parse.c" break; case 21: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 245 "lwin_wkt_parse.y" +#line 244 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2151 "lwin_wkt_parse.c" +#line 1880 "lwin_wkt_parse.c" break; case 22: /* geometrycollection: COLLECTION_TOK EMPTY_TOK */ -#line 247 "lwin_wkt_parse.y" +#line 246 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, NULL); WKT_ERROR(); } -#line 2157 "lwin_wkt_parse.c" +#line 1886 "lwin_wkt_parse.c" break; case 23: /* geometry_list: geometry_list COMMA_TOK geometry_no_srid */ -#line 251 "lwin_wkt_parse.y" +#line 250 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2163 "lwin_wkt_parse.c" +#line 1892 "lwin_wkt_parse.c" break; case 24: /* geometry_list: geometry_no_srid */ -#line 253 "lwin_wkt_parse.y" +#line 252 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2169 "lwin_wkt_parse.c" +#line 1898 "lwin_wkt_parse.c" break; case 25: /* multisurface: MSURFACE_TOK LBRACKET_TOK surface_list RBRACKET_TOK */ -#line 257 "lwin_wkt_parse.y" +#line 256 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2175 "lwin_wkt_parse.c" +#line 1904 "lwin_wkt_parse.c" break; case 26: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK surface_list RBRACKET_TOK */ -#line 259 "lwin_wkt_parse.y" +#line 258 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2181 "lwin_wkt_parse.c" +#line 1910 "lwin_wkt_parse.c" break; case 27: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 261 "lwin_wkt_parse.y" +#line 260 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2187 "lwin_wkt_parse.c" +#line 1916 "lwin_wkt_parse.c" break; case 28: /* multisurface: MSURFACE_TOK EMPTY_TOK */ -#line 263 "lwin_wkt_parse.y" +#line 262 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, NULL); WKT_ERROR(); } -#line 2193 "lwin_wkt_parse.c" +#line 1922 "lwin_wkt_parse.c" break; case 29: /* surface_list: surface_list COMMA_TOK polygon */ -#line 267 "lwin_wkt_parse.y" +#line 266 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2199 "lwin_wkt_parse.c" +#line 1928 "lwin_wkt_parse.c" break; case 30: /* surface_list: surface_list COMMA_TOK curvepolygon */ -#line 269 "lwin_wkt_parse.y" +#line 268 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2205 "lwin_wkt_parse.c" +#line 1934 "lwin_wkt_parse.c" break; case 31: /* surface_list: surface_list COMMA_TOK polygon_untagged */ -#line 271 "lwin_wkt_parse.y" +#line 270 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2211 "lwin_wkt_parse.c" +#line 1940 "lwin_wkt_parse.c" break; case 32: /* surface_list: polygon */ -#line 273 "lwin_wkt_parse.y" +#line 272 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2217 "lwin_wkt_parse.c" +#line 1946 "lwin_wkt_parse.c" break; case 33: /* surface_list: curvepolygon */ -#line 275 "lwin_wkt_parse.y" +#line 274 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2223 "lwin_wkt_parse.c" +#line 1952 "lwin_wkt_parse.c" break; case 34: /* surface_list: polygon_untagged */ -#line 277 "lwin_wkt_parse.y" +#line 276 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2229 "lwin_wkt_parse.c" +#line 1958 "lwin_wkt_parse.c" break; case 35: /* tin: TIN_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */ -#line 281 "lwin_wkt_parse.y" +#line 280 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2235 "lwin_wkt_parse.c" +#line 1964 "lwin_wkt_parse.c" break; case 36: /* tin: TIN_TOK DIMENSIONALITY_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */ -#line 283 "lwin_wkt_parse.y" +#line 282 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2241 "lwin_wkt_parse.c" +#line 1970 "lwin_wkt_parse.c" break; case 37: /* tin: TIN_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 285 "lwin_wkt_parse.y" +#line 284 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2247 "lwin_wkt_parse.c" +#line 1976 "lwin_wkt_parse.c" break; case 38: /* tin: TIN_TOK EMPTY_TOK */ -#line 287 "lwin_wkt_parse.y" +#line 286 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, NULL); WKT_ERROR(); } -#line 2253 "lwin_wkt_parse.c" +#line 1982 "lwin_wkt_parse.c" break; case 39: /* polyhedralsurface: POLYHEDRALSURFACE_TOK LBRACKET_TOK patch_list RBRACKET_TOK */ -#line 291 "lwin_wkt_parse.y" +#line 290 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2259 "lwin_wkt_parse.c" +#line 1988 "lwin_wkt_parse.c" break; case 40: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK patch_list RBRACKET_TOK */ -#line 293 "lwin_wkt_parse.y" +#line 292 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2265 "lwin_wkt_parse.c" +#line 1994 "lwin_wkt_parse.c" break; case 41: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 295 "lwin_wkt_parse.y" +#line 294 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2271 "lwin_wkt_parse.c" +#line 2000 "lwin_wkt_parse.c" break; case 42: /* polyhedralsurface: POLYHEDRALSURFACE_TOK EMPTY_TOK */ -#line 297 "lwin_wkt_parse.y" +#line 296 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, NULL); WKT_ERROR(); } -#line 2277 "lwin_wkt_parse.c" +#line 2006 "lwin_wkt_parse.c" break; case 43: /* multipolygon: MPOLYGON_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */ -#line 301 "lwin_wkt_parse.y" +#line 300 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2283 "lwin_wkt_parse.c" +#line 2012 "lwin_wkt_parse.c" break; case 44: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */ -#line 303 "lwin_wkt_parse.y" +#line 302 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2289 "lwin_wkt_parse.c" +#line 2018 "lwin_wkt_parse.c" break; case 45: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 305 "lwin_wkt_parse.y" +#line 304 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2295 "lwin_wkt_parse.c" +#line 2024 "lwin_wkt_parse.c" break; case 46: /* multipolygon: MPOLYGON_TOK EMPTY_TOK */ -#line 307 "lwin_wkt_parse.y" +#line 306 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, NULL); WKT_ERROR(); } -#line 2301 "lwin_wkt_parse.c" +#line 2030 "lwin_wkt_parse.c" break; case 47: /* polygon_list: polygon_list COMMA_TOK polygon_untagged */ -#line 311 "lwin_wkt_parse.y" +#line 310 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2307 "lwin_wkt_parse.c" +#line 2036 "lwin_wkt_parse.c" break; case 48: /* polygon_list: polygon_untagged */ -#line 313 "lwin_wkt_parse.y" +#line 312 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2313 "lwin_wkt_parse.c" +#line 2042 "lwin_wkt_parse.c" break; case 49: /* patch_list: patch_list COMMA_TOK patch */ -#line 317 "lwin_wkt_parse.y" +#line 316 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2319 "lwin_wkt_parse.c" +#line 2048 "lwin_wkt_parse.c" break; case 50: /* patch_list: patch */ -#line 319 "lwin_wkt_parse.y" +#line 318 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2325 "lwin_wkt_parse.c" +#line 2054 "lwin_wkt_parse.c" break; case 51: /* polygon: POLYGON_TOK LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 323 "lwin_wkt_parse.y" +#line 322 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2331 "lwin_wkt_parse.c" +#line 2060 "lwin_wkt_parse.c" break; case 52: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 325 "lwin_wkt_parse.y" +#line 324 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2337 "lwin_wkt_parse.c" +#line 2066 "lwin_wkt_parse.c" break; case 53: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 327 "lwin_wkt_parse.y" +#line 326 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2343 "lwin_wkt_parse.c" +#line 2072 "lwin_wkt_parse.c" break; case 54: /* polygon: POLYGON_TOK EMPTY_TOK */ -#line 329 "lwin_wkt_parse.y" +#line 328 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2349 "lwin_wkt_parse.c" +#line 2078 "lwin_wkt_parse.c" break; case 55: /* polygon_untagged: LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 333 "lwin_wkt_parse.y" +#line 332 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); } -#line 2355 "lwin_wkt_parse.c" +#line 2084 "lwin_wkt_parse.c" break; case 56: /* polygon_untagged: EMPTY_TOK */ -#line 335 "lwin_wkt_parse.y" +#line 334 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2361 "lwin_wkt_parse.c" +#line 2090 "lwin_wkt_parse.c" break; case 57: /* patch: LBRACKET_TOK patchring_list RBRACKET_TOK */ -#line 338 "lwin_wkt_parse.y" +#line 337 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); } -#line 2367 "lwin_wkt_parse.c" +#line 2096 "lwin_wkt_parse.c" break; case 58: /* curvepolygon: CURVEPOLYGON_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */ -#line 342 "lwin_wkt_parse.y" +#line 341 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2373 "lwin_wkt_parse.c" +#line 2102 "lwin_wkt_parse.c" break; case 59: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */ -#line 344 "lwin_wkt_parse.y" +#line 343 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2379 "lwin_wkt_parse.c" +#line 2108 "lwin_wkt_parse.c" break; case 60: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 346 "lwin_wkt_parse.y" +#line 345 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2385 "lwin_wkt_parse.c" +#line 2114 "lwin_wkt_parse.c" break; case 61: /* curvepolygon: CURVEPOLYGON_TOK EMPTY_TOK */ -#line 348 "lwin_wkt_parse.y" +#line 347 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2391 "lwin_wkt_parse.c" +#line 2120 "lwin_wkt_parse.c" break; case 62: /* curvering_list: curvering_list COMMA_TOK curvering */ -#line 352 "lwin_wkt_parse.y" +#line 351 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2397 "lwin_wkt_parse.c" +#line 2126 "lwin_wkt_parse.c" break; case 63: /* curvering_list: curvering */ -#line 354 "lwin_wkt_parse.y" +#line 353 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2403 "lwin_wkt_parse.c" +#line 2132 "lwin_wkt_parse.c" break; case 64: /* curvering: linestring_untagged */ -#line 357 "lwin_wkt_parse.y" +#line 356 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2409 "lwin_wkt_parse.c" +#line 2138 "lwin_wkt_parse.c" break; case 65: /* curvering: linestring */ -#line 358 "lwin_wkt_parse.y" +#line 357 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2415 "lwin_wkt_parse.c" +#line 2144 "lwin_wkt_parse.c" break; case 66: /* curvering: compoundcurve */ -#line 359 "lwin_wkt_parse.y" +#line 358 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2421 "lwin_wkt_parse.c" +#line 2150 "lwin_wkt_parse.c" break; case 67: /* curvering: circularstring */ -#line 360 "lwin_wkt_parse.y" +#line 359 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2427 "lwin_wkt_parse.c" +#line 2156 "lwin_wkt_parse.c" break; case 68: /* patchring_list: patchring_list COMMA_TOK patchring */ -#line 364 "lwin_wkt_parse.y" +#line 363 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); } -#line 2433 "lwin_wkt_parse.c" +#line 2162 "lwin_wkt_parse.c" break; case 69: /* patchring_list: patchring */ -#line 366 "lwin_wkt_parse.y" +#line 365 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); } -#line 2439 "lwin_wkt_parse.c" +#line 2168 "lwin_wkt_parse.c" break; case 70: /* ring_list: ring_list COMMA_TOK ring */ -#line 370 "lwin_wkt_parse.y" +#line 369 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); } -#line 2445 "lwin_wkt_parse.c" +#line 2174 "lwin_wkt_parse.c" break; case 71: /* ring_list: ring */ -#line 372 "lwin_wkt_parse.y" +#line 371 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); } -#line 2451 "lwin_wkt_parse.c" +#line 2180 "lwin_wkt_parse.c" break; case 72: /* patchring: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 375 "lwin_wkt_parse.y" +#line 374 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); } -#line 2457 "lwin_wkt_parse.c" +#line 2186 "lwin_wkt_parse.c" break; case 73: /* ring: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 378 "lwin_wkt_parse.y" +#line 377 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); } -#line 2463 "lwin_wkt_parse.c" +#line 2192 "lwin_wkt_parse.c" break; case 74: /* compoundcurve: COMPOUNDCURVE_TOK LBRACKET_TOK compound_list RBRACKET_TOK */ -#line 382 "lwin_wkt_parse.y" +#line 381 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2469 "lwin_wkt_parse.c" +#line 2198 "lwin_wkt_parse.c" break; case 75: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK compound_list RBRACKET_TOK */ -#line 384 "lwin_wkt_parse.y" +#line 383 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2475 "lwin_wkt_parse.c" +#line 2204 "lwin_wkt_parse.c" break; case 76: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 386 "lwin_wkt_parse.y" +#line 385 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2481 "lwin_wkt_parse.c" +#line 2210 "lwin_wkt_parse.c" break; case 77: /* compoundcurve: COMPOUNDCURVE_TOK EMPTY_TOK */ -#line 388 "lwin_wkt_parse.y" +#line 387 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, NULL); WKT_ERROR(); } -#line 2487 "lwin_wkt_parse.c" +#line 2216 "lwin_wkt_parse.c" break; case 78: /* compound_list: compound_list COMMA_TOK circularstring */ -#line 392 "lwin_wkt_parse.y" +#line 391 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2493 "lwin_wkt_parse.c" +#line 2222 "lwin_wkt_parse.c" break; case 79: /* compound_list: compound_list COMMA_TOK linestring */ -#line 394 "lwin_wkt_parse.y" +#line 393 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2499 "lwin_wkt_parse.c" +#line 2228 "lwin_wkt_parse.c" break; case 80: /* compound_list: compound_list COMMA_TOK linestring_untagged */ -#line 396 "lwin_wkt_parse.y" +#line 395 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2505 "lwin_wkt_parse.c" +#line 2234 "lwin_wkt_parse.c" break; case 81: /* compound_list: circularstring */ -#line 398 "lwin_wkt_parse.y" +#line 397 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2511 "lwin_wkt_parse.c" +#line 2240 "lwin_wkt_parse.c" break; case 82: /* compound_list: linestring */ -#line 400 "lwin_wkt_parse.y" +#line 399 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2517 "lwin_wkt_parse.c" +#line 2246 "lwin_wkt_parse.c" break; case 83: /* compound_list: linestring_untagged */ -#line 402 "lwin_wkt_parse.y" +#line 401 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2523 "lwin_wkt_parse.c" +#line 2252 "lwin_wkt_parse.c" break; case 84: /* multicurve: MCURVE_TOK LBRACKET_TOK curve_list RBRACKET_TOK */ -#line 406 "lwin_wkt_parse.y" +#line 405 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2529 "lwin_wkt_parse.c" +#line 2258 "lwin_wkt_parse.c" break; case 85: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK curve_list RBRACKET_TOK */ -#line 408 "lwin_wkt_parse.y" +#line 407 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2535 "lwin_wkt_parse.c" +#line 2264 "lwin_wkt_parse.c" break; case 86: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 410 "lwin_wkt_parse.y" +#line 409 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2541 "lwin_wkt_parse.c" +#line 2270 "lwin_wkt_parse.c" break; case 87: /* multicurve: MCURVE_TOK EMPTY_TOK */ -#line 412 "lwin_wkt_parse.y" +#line 411 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, NULL); WKT_ERROR(); } -#line 2547 "lwin_wkt_parse.c" +#line 2276 "lwin_wkt_parse.c" break; case 88: /* curve_list: curve_list COMMA_TOK circularstring */ -#line 416 "lwin_wkt_parse.y" +#line 415 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2553 "lwin_wkt_parse.c" +#line 2282 "lwin_wkt_parse.c" break; case 89: /* curve_list: curve_list COMMA_TOK compoundcurve */ -#line 418 "lwin_wkt_parse.y" +#line 417 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2559 "lwin_wkt_parse.c" +#line 2288 "lwin_wkt_parse.c" break; case 90: /* curve_list: curve_list COMMA_TOK linestring */ -#line 420 "lwin_wkt_parse.y" +#line 419 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2565 "lwin_wkt_parse.c" +#line 2294 "lwin_wkt_parse.c" break; case 91: /* curve_list: curve_list COMMA_TOK linestring_untagged */ -#line 422 "lwin_wkt_parse.y" +#line 421 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2571 "lwin_wkt_parse.c" +#line 2300 "lwin_wkt_parse.c" break; case 92: /* curve_list: circularstring */ -#line 424 "lwin_wkt_parse.y" +#line 423 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2577 "lwin_wkt_parse.c" +#line 2306 "lwin_wkt_parse.c" break; case 93: /* curve_list: compoundcurve */ -#line 426 "lwin_wkt_parse.y" +#line 425 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2583 "lwin_wkt_parse.c" +#line 2312 "lwin_wkt_parse.c" break; case 94: /* curve_list: linestring */ -#line 428 "lwin_wkt_parse.y" +#line 427 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2589 "lwin_wkt_parse.c" +#line 2318 "lwin_wkt_parse.c" break; case 95: /* curve_list: linestring_untagged */ -#line 430 "lwin_wkt_parse.y" +#line 429 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2595 "lwin_wkt_parse.c" +#line 2324 "lwin_wkt_parse.c" break; case 96: /* multilinestring: MLINESTRING_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */ -#line 434 "lwin_wkt_parse.y" +#line 433 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2601 "lwin_wkt_parse.c" +#line 2330 "lwin_wkt_parse.c" break; case 97: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */ -#line 436 "lwin_wkt_parse.y" +#line 435 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2607 "lwin_wkt_parse.c" +#line 2336 "lwin_wkt_parse.c" break; case 98: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 438 "lwin_wkt_parse.y" +#line 437 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2613 "lwin_wkt_parse.c" +#line 2342 "lwin_wkt_parse.c" break; case 99: /* multilinestring: MLINESTRING_TOK EMPTY_TOK */ -#line 440 "lwin_wkt_parse.y" +#line 439 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, NULL); WKT_ERROR(); } -#line 2619 "lwin_wkt_parse.c" +#line 2348 "lwin_wkt_parse.c" break; case 100: /* linestring_list: linestring_list COMMA_TOK linestring_untagged */ -#line 444 "lwin_wkt_parse.y" +#line 443 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2625 "lwin_wkt_parse.c" +#line 2354 "lwin_wkt_parse.c" break; case 101: /* linestring_list: linestring_untagged */ -#line 446 "lwin_wkt_parse.y" +#line 445 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2631 "lwin_wkt_parse.c" +#line 2360 "lwin_wkt_parse.c" break; case 102: /* circularstring: CIRCULARSTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 450 "lwin_wkt_parse.y" +#line 449 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2637 "lwin_wkt_parse.c" +#line 2366 "lwin_wkt_parse.c" break; case 103: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 452 "lwin_wkt_parse.y" +#line 451 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2643 "lwin_wkt_parse.c" +#line 2372 "lwin_wkt_parse.c" break; case 104: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 454 "lwin_wkt_parse.y" +#line 453 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2649 "lwin_wkt_parse.c" +#line 2378 "lwin_wkt_parse.c" break; case 105: /* circularstring: CIRCULARSTRING_TOK EMPTY_TOK */ -#line 456 "lwin_wkt_parse.y" +#line 455 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, NULL); WKT_ERROR(); } -#line 2655 "lwin_wkt_parse.c" +#line 2384 "lwin_wkt_parse.c" break; case 106: /* linestring: LINESTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 460 "lwin_wkt_parse.y" +#line 459 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2661 "lwin_wkt_parse.c" +#line 2390 "lwin_wkt_parse.c" break; case 107: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 462 "lwin_wkt_parse.y" +#line 461 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2667 "lwin_wkt_parse.c" +#line 2396 "lwin_wkt_parse.c" break; case 108: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 464 "lwin_wkt_parse.y" +#line 463 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2673 "lwin_wkt_parse.c" +#line 2402 "lwin_wkt_parse.c" break; case 109: /* linestring: LINESTRING_TOK EMPTY_TOK */ -#line 466 "lwin_wkt_parse.y" +#line 465 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); } -#line 2679 "lwin_wkt_parse.c" +#line 2408 "lwin_wkt_parse.c" break; case 110: /* linestring_untagged: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 470 "lwin_wkt_parse.y" +#line 469 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2685 "lwin_wkt_parse.c" +#line 2414 "lwin_wkt_parse.c" break; case 111: /* linestring_untagged: EMPTY_TOK */ -#line 472 "lwin_wkt_parse.y" +#line 471 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); } -#line 2691 "lwin_wkt_parse.c" +#line 2420 "lwin_wkt_parse.c" break; case 112: /* triangle_list: triangle_list COMMA_TOK triangle_untagged */ -#line 476 "lwin_wkt_parse.y" +#line 475 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2697 "lwin_wkt_parse.c" +#line 2426 "lwin_wkt_parse.c" break; case 113: /* triangle_list: triangle_untagged */ -#line 478 "lwin_wkt_parse.y" +#line 477 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2703 "lwin_wkt_parse.c" +#line 2432 "lwin_wkt_parse.c" break; case 114: /* triangle: TRIANGLE_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 482 "lwin_wkt_parse.y" +#line 481 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2709 "lwin_wkt_parse.c" +#line 2438 "lwin_wkt_parse.c" break; case 115: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 484 "lwin_wkt_parse.y" +#line 483 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), (yyvsp[-5].stringvalue)); WKT_ERROR(); } -#line 2715 "lwin_wkt_parse.c" +#line 2444 "lwin_wkt_parse.c" break; case 116: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 486 "lwin_wkt_parse.y" +#line 485 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2721 "lwin_wkt_parse.c" +#line 2450 "lwin_wkt_parse.c" break; case 117: /* triangle: TRIANGLE_TOK EMPTY_TOK */ -#line 488 "lwin_wkt_parse.y" +#line 487 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, NULL); WKT_ERROR(); } -#line 2727 "lwin_wkt_parse.c" +#line 2456 "lwin_wkt_parse.c" break; case 118: /* triangle_untagged: LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 492 "lwin_wkt_parse.y" +#line 491 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2733 "lwin_wkt_parse.c" +#line 2462 "lwin_wkt_parse.c" break; case 119: /* multipoint: MPOINT_TOK LBRACKET_TOK point_list RBRACKET_TOK */ -#line 496 "lwin_wkt_parse.y" +#line 495 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2739 "lwin_wkt_parse.c" +#line 2468 "lwin_wkt_parse.c" break; case 120: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK point_list RBRACKET_TOK */ -#line 498 "lwin_wkt_parse.y" +#line 497 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2745 "lwin_wkt_parse.c" +#line 2474 "lwin_wkt_parse.c" break; case 121: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 500 "lwin_wkt_parse.y" +#line 499 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2751 "lwin_wkt_parse.c" +#line 2480 "lwin_wkt_parse.c" break; case 122: /* multipoint: MPOINT_TOK EMPTY_TOK */ -#line 502 "lwin_wkt_parse.y" +#line 501 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, NULL); WKT_ERROR(); } -#line 2757 "lwin_wkt_parse.c" +#line 2486 "lwin_wkt_parse.c" break; case 123: /* point_list: point_list COMMA_TOK point_untagged */ -#line 506 "lwin_wkt_parse.y" +#line 505 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2763 "lwin_wkt_parse.c" +#line 2492 "lwin_wkt_parse.c" break; case 124: /* point_list: point_untagged */ -#line 508 "lwin_wkt_parse.y" +#line 507 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2769 "lwin_wkt_parse.c" +#line 2498 "lwin_wkt_parse.c" break; case 125: /* point_untagged: coordinate */ -#line 512 "lwin_wkt_parse.y" +#line 511 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)),NULL); WKT_ERROR(); } -#line 2775 "lwin_wkt_parse.c" +#line 2504 "lwin_wkt_parse.c" break; case 126: /* point_untagged: LBRACKET_TOK coordinate RBRACKET_TOK */ -#line 514 "lwin_wkt_parse.y" +#line 513 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[-1].coordinatevalue)),NULL); WKT_ERROR(); } -#line 2781 "lwin_wkt_parse.c" +#line 2510 "lwin_wkt_parse.c" break; case 127: /* point_untagged: EMPTY_TOK */ -#line 516 "lwin_wkt_parse.y" +#line 515 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL, NULL); WKT_ERROR(); } -#line 2787 "lwin_wkt_parse.c" +#line 2516 "lwin_wkt_parse.c" break; case 128: /* point: POINT_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 520 "lwin_wkt_parse.y" +#line 519 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2793 "lwin_wkt_parse.c" +#line 2522 "lwin_wkt_parse.c" break; case 129: /* point: POINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 522 "lwin_wkt_parse.y" +#line 521 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2799 "lwin_wkt_parse.c" +#line 2528 "lwin_wkt_parse.c" break; case 130: /* point: POINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 524 "lwin_wkt_parse.y" +#line 523 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2805 "lwin_wkt_parse.c" +#line 2534 "lwin_wkt_parse.c" break; case 131: /* point: POINT_TOK EMPTY_TOK */ -#line 526 "lwin_wkt_parse.y" +#line 525 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL,NULL); WKT_ERROR(); } -#line 2811 "lwin_wkt_parse.c" +#line 2540 "lwin_wkt_parse.c" break; case 132: /* ptarray: ptarray COMMA_TOK coordinate */ -#line 530 "lwin_wkt_parse.y" +#line 529 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = wkt_parser_ptarray_add_coord((yyvsp[-2].ptarrayvalue), (yyvsp[0].coordinatevalue)); WKT_ERROR(); } -#line 2817 "lwin_wkt_parse.c" +#line 2546 "lwin_wkt_parse.c" break; case 133: /* ptarray: coordinate */ -#line 532 "lwin_wkt_parse.y" +#line 531 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)); WKT_ERROR(); } -#line 2823 "lwin_wkt_parse.c" +#line 2552 "lwin_wkt_parse.c" break; case 134: /* coordinate: DOUBLE_TOK DOUBLE_TOK */ -#line 536 "lwin_wkt_parse.y" +#line 535 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_2((yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2829 "lwin_wkt_parse.c" +#line 2558 "lwin_wkt_parse.c" break; case 135: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */ -#line 538 "lwin_wkt_parse.y" +#line 537 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_3((yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2835 "lwin_wkt_parse.c" +#line 2564 "lwin_wkt_parse.c" break; case 136: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */ -#line 540 "lwin_wkt_parse.y" +#line 539 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_4((yyvsp[-3].doublevalue), (yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2841 "lwin_wkt_parse.c" +#line 2570 "lwin_wkt_parse.c" break; -#line 2845 "lwin_wkt_parse.c" +#line 2574 "lwin_wkt_parse.c" default: break; } @@ -2889,37 +2618,7 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; - { - yypcontext_t yyctx - = {yyssp, yytoken, &yylloc}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == -1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (yymsg) - { - yysyntax_error_status - = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } + yyerror (YY_("syntax error")); } yyerror_range[1] = yylloc; @@ -3065,11 +2764,10 @@ yyreturnlab: if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + return yyresult; } -#line 542 "lwin_wkt_parse.y" +#line 541 "lwin_wkt_parse.y" diff --git a/liblwgeom/lwin_wkt_parse.h b/liblwgeom/lwin_wkt_parse.h index f9365f3c2..12e27aee2 100644 --- a/liblwgeom/lwin_wkt_parse.h +++ b/liblwgeom/lwin_wkt_parse.h @@ -85,7 +85,7 @@ extern int wkt_yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 112 "lwin_wkt_parse.y" +#line 111 "lwin_wkt_parse.y" int integervalue; double doublevalue; diff --git a/liblwgeom/lwin_wkt_parse.y b/liblwgeom/lwin_wkt_parse.y index 1e03d41f0..0c1e63126 100644 --- a/liblwgeom/lwin_wkt_parse.y +++ b/liblwgeom/lwin_wkt_parse.y @@ -45,7 +45,7 @@ void wkt_yyerror(__attribute__((__unused__)) const char *str) * (eg, from within other functions in lwin_wkt.c) or from a threaded program. * Note that parser_result.wkinput picks up a reference to wktstr. */ -int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags) +int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parser_check_flags) { int parse_rv = 0; @@ -107,7 +107,6 @@ int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int pars %} %locations -%define parse.error verbose %union { int integervalue; diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..f8746f3bc 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -35,6 +35,7 @@ /* Global variables */ #include "../postgis_config.h" #include "liblwgeom_internal.h" +#include "stringbuffer.h" #include "lwgeom_log.h" /* Default allocators */ @@ -260,81 +261,48 @@ lwstrdup(const char* a) } /* - * Returns a new string which contains a maximum of maxlength characters starting - * from startpos and finishing at endpos (0-based indexing). If the string is - * truncated then the first or last characters are replaced by "..." as - * appropriate. - * - * The caller should specify start or end truncation by setting the truncdirection - * parameter as follows: - * 0 - start truncation (i.e. characters are removed from the beginning) - * 1 - end truncation (i.e. characters are removed from the end) + * Returns the characters to the left of the error position + * to a maximum of maxlength. */ - -char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection) +char * +lwmessage_truncate(const char *str, int errpos, int maxlength) { - char *output; - char *outstart; + int str_sz; + int startpos; - /* Allocate space for new string */ - output = lwalloc(maxlength + 4); - output[0] = '\0'; + assert(str != NULL); + assert(errpos >= 0); + assert(maxlength > 0); - /* Start truncation */ - if (truncdirection == 0) + str_sz = strlen(str); + + stringbuffer_t sb; + stringbuffer_init(&sb); + + /* Error cannot be past end of WKT */ + if (errpos > str_sz) + errpos = str_sz; + + /* Go back maxlength from errpos but not past zero */ + startpos = errpos - maxlength; + if (startpos < 0) + startpos = 0; + + if (str_sz < maxlength) { - /* Calculate the start position */ - if (endpos - startpos < maxlength) - { - outstart = str + startpos; - strncat(output, outstart, endpos - startpos + 1); - } - else - { - if (maxlength >= 3) - { - /* Add "..." prefix */ - outstart = str + endpos + 1 - maxlength + 3; - strncat(output, "...", 4); - strncat(output, outstart, maxlength - 3); - } - else - { - /* maxlength is too small; just output "..." */ - strncat(output, "...", 4); - } - } + stringbuffer_append(&sb, str); + } + else + { + /* Add "..." prefix */ + stringbuffer_append(&sb, "..."); + stringbuffer_append_len(&sb, str + startpos, errpos-startpos); } - /* End truncation */ - if (truncdirection == 1) - { - /* Calculate the end position */ - if (endpos - startpos < maxlength) - { - outstart = str + startpos; - strncat(output, outstart, endpos - startpos + 1); - } - else - { - if (maxlength >= 3) - { - /* Add "..." suffix */ - outstart = str + startpos; - strncat(output, outstart, maxlength - 3); - strncat(output, "...", 4); - } - else - { - /* maxlength is too small; just output "..." */ - strncat(output, "...", 4); - } - } - } - - return output; + return stringbuffer_getstringcopy(&sb); } + int32_t clamp_srid(int32_t srid) { diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c index 5e14aa132..fbbe5b73b 100644 --- a/libpgcommon/lwgeom_pg.c +++ b/libpgcommon/lwgeom_pg.c @@ -285,11 +285,11 @@ pg_parser_errhint(LWGEOM_PARSER_RESULT *lwg_parser_result) within the input stream cannot be matched */ if (lwg_parser_result->errlocation > 0) { - /* Return a copy of the input string start truncated - * at the error location */ + /* Return a short copy of the input string truncated at the error location */ hintbuffer = lwmessage_truncate( - (char *)lwg_parser_result->wkinput, 0, - lwg_parser_result->errlocation - 1, 40, 0); + lwg_parser_result->wkinput, /* wkt */ + lwg_parser_result->errlocation, /* errpos */ + 40); /* maxlen */ ereport(ERROR, (errmsg("%s", lwg_parser_result->message), ----------------------------------------------------------------------- Summary of changes: liblwgeom/liblwgeom.h.in | 4 +- liblwgeom/lwin_wkt.c | 2 +- liblwgeom/lwin_wkt.h | 2 +- liblwgeom/lwin_wkt_lex.c | 68 +-- liblwgeom/lwin_wkt_lex.l | 8 +- liblwgeom/lwin_wkt_parse.c | 1036 ++++++++++++++++---------------------------- liblwgeom/lwin_wkt_parse.h | 2 +- liblwgeom/lwin_wkt_parse.y | 3 +- liblwgeom/lwutil.c | 96 ++-- libpgcommon/lwgeom_pg.c | 8 +- 10 files changed, 449 insertions(+), 780 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:04:18 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:04:18 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.dd0455c9f6d711db687fd69d9d12370a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"6f3355d3a1046c5f1af80e499cbad6f4f438dd9d/git" 6f3355d3/git]: {{{#!CommitTicketReference repository="git" revision="6f3355d3a1046c5f1af80e499cbad6f4f438dd9d" Rework the WKT parser position counter, which was dramatically over counting the parse position, resulting in bad memory accesses for long enough inputs with errors near the ends. References #6061 }}} -- Ticket URL: 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. From trac at osgeo.org Thu Apr 9 15:04:46 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:04:46 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.0d21812813f64ba558578fac0c7fb7da@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: 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. From git at osgeo.org Thu Apr 9 16:26:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 16:26:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-8-g4c42e775c Message-ID: <20260409232651.D3145181088@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.2 has been updated via 4c42e775cf77ea08e3a5999c561f1e8ebcd03ddb (commit) from d491e6a68b19b3a049f72fb5e3b6b9f007e04295 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4c42e775cf77ea08e3a5999c561f1e8ebcd03ddb Author: Paul Ramsey Date: Thu Apr 9 16:26:45 2026 -0700 Ensure lexer is generated and committed diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index 0ba962865..b92567a18 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, - 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, + 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, + 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,42 +678,44 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[36] = +static const YY_CHAR yy_meta[53] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, - 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, - 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, - 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, - 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, - 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, - 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, - 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, - 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, - 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, + 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, + 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, + 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, + 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, + 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, + 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, + 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, + 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, + 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, + 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, - 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, - 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, - 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, - 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, - 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, - 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, - 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, - 67, 54, 39, 221, 221, 221 + 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, + 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, + 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, + 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, + 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, + 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, + 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, + 342, 351, 347, 391, 391, 391 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -732,68 +734,110 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[257] = +static const flex_int16_t yy_nxt[444] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, - 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, - 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, - 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, - 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, - 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, - 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, + 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, + 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, + 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, + 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, + 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, - 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, - 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, + 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, + 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, + 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, + 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, + 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, + 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, + 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, + 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, + 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, + 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, - 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, - 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, + 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, + 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, + 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, + 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, + 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, + 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, + 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, + 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, + 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, + 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, + + 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, + 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, + 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, + 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, + 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, + 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, + 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, + 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, + 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; -static const flex_int16_t yy_chk[257] = +static const flex_int16_t yy_chk[444] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, - 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, - 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, - 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, - 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, - 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, - 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, + 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, + 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, - 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, - 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, - 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, - 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, - 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, - 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, + 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, + 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, + 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, + 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, + 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, + 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, + 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, + 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, + 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, + + 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, + 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, + 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, + 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, + 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, + 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, + 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, + 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, + 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, + 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, + + 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, + 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, + 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, + 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, + 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, + 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, + 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, + 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, + 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, - 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -859,10 +903,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 862 "lwin_wkt_lex.c" +#line 906 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 865 "lwin_wkt_lex.c" +#line 909 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1080,7 +1124,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1083 "lwin_wkt_lex.c" +#line 1127 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1159,7 +1203,7 @@ YY_RULE_SETUP LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } YY_BREAK case 3: YY_RULE_SETUP @@ -1299,7 +1343,7 @@ YY_RULE_SETUP #line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1302 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index f2a4d963c..0f214e071 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -69,7 +69,7 @@ static void wkt_lexer_unknown() LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } SRID=-?[0-9]+ { LWDEBUG(5,"SRID"); ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwin_wkt_lex.c | 198 +++++++++++++++++++++++++++++------------------ liblwgeom/lwin_wkt_lex.l | 2 +- 2 files changed, 122 insertions(+), 78 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 16:29:36 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 16:29:36 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-16-g77143e990 Message-ID: <20260409232936.50914180A7F@trac.osgeo.org> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "PostGIS". The branch, stable-3.4 has been updated via 77143e9908ff70d7d8085a2559de21fc85a9950c (commit) from a94af577180ed222ec217a20c4330713b40936ce (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 77143e9908ff70d7d8085a2559de21fc85a9950c Author: Paul Ramsey Date: Thu Apr 9 16:29:31 2026 -0700 Ensure lexer is generated and committed diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index 0ba962865..b92567a18 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, - 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, + 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, + 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,42 +678,44 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[36] = +static const YY_CHAR yy_meta[53] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, - 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, - 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, - 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, - 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, - 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, - 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, - 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, - 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, - 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, + 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, + 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, + 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, + 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, + 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, + 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, + 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, + 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, + 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, + 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, - 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, - 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, - 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, - 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, - 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, - 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, - 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, - 67, 54, 39, 221, 221, 221 + 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, + 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, + 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, + 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, + 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, + 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, + 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, + 342, 351, 347, 391, 391, 391 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -732,68 +734,110 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[257] = +static const flex_int16_t yy_nxt[444] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, - 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, - 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, - 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, - 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, - 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, - 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, + 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, + 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, + 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, + 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, + 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, - 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, - 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, + 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, + 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, + 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, + 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, + 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, + 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, + 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, + 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, + 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, + 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, - 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, - 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, + 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, + 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, + 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, + 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, + 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, + 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, + 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, + 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, + 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, + 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, + + 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, + 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, + 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, + 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, + 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, + 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, + 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, + 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, + 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; -static const flex_int16_t yy_chk[257] = +static const flex_int16_t yy_chk[444] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, - 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, - 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, - 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, - 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, - 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, - 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, + 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, + 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, - 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, - 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, - 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, - 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, - 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, - 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, + 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, + 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, + 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, + 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, + 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, + 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, + 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, + 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, + 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, + + 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, + 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, + 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, + 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, + 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, + 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, + 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, + 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, + 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, + 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, + + 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, + 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, + 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, + 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, + 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, + 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, + 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, + 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, + 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, - 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -859,10 +903,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 862 "lwin_wkt_lex.c" +#line 906 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 865 "lwin_wkt_lex.c" +#line 909 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1080,7 +1124,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1083 "lwin_wkt_lex.c" +#line 1127 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1159,7 +1203,7 @@ YY_RULE_SETUP LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } YY_BREAK case 3: YY_RULE_SETUP @@ -1299,7 +1343,7 @@ YY_RULE_SETUP #line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1302 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index f2a4d963c..0f214e071 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -69,7 +69,7 @@ static void wkt_lexer_unknown() LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } SRID=-?[0-9]+ { LWDEBUG(5,"SRID"); ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwin_wkt_lex.c | 198 +++++++++++++++++++++++++++++------------------ liblwgeom/lwin_wkt_lex.l | 2 +- 2 files changed, 122 insertions(+), 78 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Apr 10 11:28:58 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 10 Apr 2026 18:28:58 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.4944c504a9d391dcdb5c36911ac7f8bc@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+-------------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: closed Priority: blocker | Milestone: PostGIS PostgreSQL Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+-------------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed Comment: PgSQL has been patched at https://github.com/postgres/postgres/commit/34a307862930056e1976471d6d81a5e2efc148df -- Ticket URL: 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. From trac at osgeo.org Fri Apr 10 18:16:09 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:16:09 -0000 Subject: [PostGIS] #6067: MacOS CI failing on topology topogeo_addlinestring, validatetopology Message-ID: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> #6067: MacOS CI failing on topology topogeo_addlinestring, validatetopology ----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Keywords: | ----------------------+--------------------------- GHA MacOS CI appears to be failing on 2 topology tests: {{{ Run tests: 260 Failed: 2 make: *** [check-regress] Error 2 ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- ---- /tmp/pgis_reg/test_236_diff ---- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ---- /tmp/pgis_reg/test_254_diff ---- --- ./topology/test/regress/validatetopology_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---- END REGRESSION DIFFS ---- Stopping `postgresql at 17`... (might take a while) ==> Successfully stopped `postgresql at 17` (label: homebrew.mxcl.postgresql at 17) }}} -- Ticket URL: 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. From trac at osgeo.org Fri Apr 10 18:19:11 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:19:11 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology (was: MacOS CI failing on topology topogeo_addlinestring, validatetopology) In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.03a2c67a46cc65f90a9c9a27a9902f87@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * summary: MacOS CI failing on topology topogeo_addlinestring, validatetopology => MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology Old description: > GHA MacOS CI appears to be failing on 2 topology tests: > > {{{ > Run tests: 260 > Failed: 2 > make: *** [check-regress] Error 2 > ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- > ---- /tmp/pgis_reg/test_236_diff ---- > --- ./topology/test/regress/topogeo_addlinestring_expected > 2026-04-09 22:05:58 > +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 > @@ -236,3 +236,4 @@ > t6062.edges|t > t6064.1|t > t6064.2|t > +t6064.check.final|hole not in advertised face|-5| > ---- /tmp/pgis_reg/test_254_diff ---- > --- ./topology/test/regress/validatetopology_expected 2026-04-09 > 22:05:58 > +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 > @@ -46,4 +46,3 @@ > #5766.2|no bbox|("face has wrong mbr",0,) > #5766.2|overlapping bbox|("face has wrong mbr",0,) > #5766.2|disjoint bbox| > -#6065|invalidities|hole not in advertised face|-4| > ---- END REGRESSION DIFFS ---- > Stopping `postgresql at 17`... (might take a while) > ==> Successfully stopped `postgresql at 17` (label: > homebrew.mxcl.postgresql at 17) > }}} New description: GHA MacOS CI appears to be failing on 2 topology tests: https://github.com/postgis/postgis/runs/70695353289 {{{ Run tests: 260 Failed: 2 make: *** [check-regress] Error 2 ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- ---- /tmp/pgis_reg/test_236_diff ---- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ---- /tmp/pgis_reg/test_254_diff ---- --- ./topology/test/regress/validatetopology_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---- END REGRESSION DIFFS ---- Stopping `postgresql at 17`... (might take a while) ==> Successfully stopped `postgresql at 17` (label: homebrew.mxcl.postgresql at 17) }}} Winnie shows similar and I think my local system has these failures as well: From winnie: https://winnie.postgis.net/job/PostGIS_EDB_Regress_winnie/22345/consoleFull {{{ ./topology/test/regress/topogeo_addlinestring .. failed (diff expected obtained: E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_240_diff) ----------------------------------------------------------------------------- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 17:19:20.643388100 -0400 +++ E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_240_out 2026-04-09 18:50:05.337133800 -0400 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ----------------------------------------------------------------------------- ./topology/test/regress/validatetopology .. failed (diff expected obtained: E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_258_diff) ----------------------------------------------------------------------------- --- ./topology/test/regress/validatetopology_expected 2026-04-09 17:19:20.674641200 -0400 +++ E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_258_out 2026-04-09 18:50:33.651908900 -0400 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---------------------------------------------------------------------------- }}} -- Comment: I thi -- Ticket URL: 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. From trac at osgeo.org Fri Apr 10 18:21:19 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:21:19 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.2adabd665bb9b9df1af180a5fd076c26@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): FWIW on winnie, all was good until April 8th with this commit https://gitea.osgeo.org/postgis/postgis/commit/7e3d523cda37faa3efdb8daed91e73df6a9fe864 -- Ticket URL: 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. From trac at osgeo.org Fri Apr 10 18:26:47 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:26:47 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.78634efed1a54e6e679f89fb1186dd49@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): Confirmed MacOS started failing after the same commit that made winnie unhappy. -- Ticket URL: 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. From trac at osgeo.org Sat Apr 11 04:09:57 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 11:09:57 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.b1a872e1204bd532e7f3c28627b9c899@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The failure is due to `ptarray_signed_area` being unable to compute non- zero area of a triangle with outgoing spikes (collapsed parts). The use of `long double` fixed this on some systems but it's a partial fix as it depends on platform, apparently. -- Ticket URL: 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.