#5241 closed defect (fixed)
ST_SnapToGrid crashes on multipolygon with an empty polygon
Reported by: | robe | Owned by: | robe |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 2.5.9 |
Component: | postgis | Version: | 3.2.x |
Keywords: | Cc: |
Description (last modified by )
SELECT ST_SnapToGrid(foo1.the_geom, 20.1, 20.1, 20.1, 20.1) As result FROM ( (SELECT ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326) As the_geom ) ) As foo1 LIMIT 10;
I tested this on 3.2.4dev, but assume it crashes on older
Change History (18)
comment:1 by , 2 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
comment:2 by , 2 years ago
comment:5 by , 2 years ago
Milestone: | PostGIS 3.0.8 → PostGIS 2.5.9 |
---|
comment:11 by , 2 years ago
Okay looks like berrie64 prefers to round the numbers thus disagreeing with the answer for the new test
10:46:09 ./regress/core/snaptogrid .. failed (diff expected obtained: /tmp/pgis_reg/test_72_diff) 10:46:09 ----------------------------------------------------------------------------- 10:46:09 --- ./regress/core/snaptogrid_expected 2022-10-29 08:36:23.540007775 -0600 10:46:09 +++ /tmp/pgis_reg/test_72_out 2022-10-29 08:46:09.107263583 -0600 10:46:09 @@ -6,4 +6,4 @@ 10:46:09 POLYGON((0 0,10 0,10 10,0 10,0 0))|BOX(0 0,10 10) 10:46:09 POLYGON((0 0,10 0,10 10,0 10,0 0))|BOX(0 0,10 10) 10:46:09 #5241|MULTIPOLYGON EMPTY 10:46:09 -#5241|MULTIPOLYGON(((9 9,9 1,1 1,2 4,7.000000000000001 7.000000000000001,9 9))) 10:46:09 +#5241|MULTIPOLYGON(((9 9,9 1,1 1,2 4,7 7,9 9))) 10:46:09 -----------------------------------------------------------------------------
Need to revise to round the output so all bots agree. Why berrie isn't having the same issue seems odd.
Note:
See TracTickets
for help on using tickets.
GDB shows the issue is here.
Which is a surprise to me. I can't figure out why it crashes there.
If in the lwgeom_grid_in_place function I add a line
It regresses and doesn't crash anymore, and returns expected answer, though I need to test with a smaller grid to confirm.
But I don't know how to protect the ultimate root cause and if that root cause could be hole for other things.