ogr2ogr with missing geometries crashes postgresql with segmentation fault
Paul Ramsey
pramsey at cleverelephant.ca
Sat Dec 13 18:28:09 PST 2025
First, thank you for a perfect minimal reproducer right up front. Very helpful and I have confirmed a crash here too. I haven’t put it into the debugger yet. Your empty polygon is pretty cool (as polygons tend to be) since it is not a classic “polygon with no rings” empty polygon, it is a “polygon with one ring that has no points” empty polygon.
01 // LITTLE ENDIAN.
03000020 // POLYGON, WITH SRID
97130000 // SRID 5015
01000000 // ONE RING
00000000 // ZERO POINTS
Why that causes a crash in the index code (or perhaps the bounding box extraction code) is yet to be determined.
Anyways, very exciting to have a crasher, quite a rare defect these days.
ATB,
P.
> On Dec 12, 2025, at 5:19 PM, Jorge Gustavo Rocha <jgr at di.uminho.pt> wrote:
>
> TL;DR
>
> A GIST index on a EMPTY POLYGON (encoded by GDAL) crashes postgresql with segmentation fault.
>
> drop table if exists fault;
> create table fault (fid integer, geom geometry(Polygon,5015));
> INSERT INTO fault (fid, geom) VALUES (1, '0103000020971300000100000000000000'::GEOMETRY);
> CREATE INDEX fault_geom_index ON fault USING GIST (geom);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20251213/289baee1/attachment.htm>
More information about the postgis-users
mailing list