ogr2ogr with missing geometries crashes postgresql with segmentation fault

Jorge Gustavo Rocha jgr at di.uminho.pt
Mon Dec 15 16:55:02 PST 2025


Amazing work, Paul!

Thank you,

Jorge

Às 00:35 de 16/12/25, Paul Ramsey escreveu:
> Should be fixed in all stable branches and going forward.
>
> On Mon, Dec 15, 2025 at 9:15 AM Paul Ramsey 
> <pramsey at cleverelephant.ca> wrote:
>
>     I have started a ticket, and have a fix in hand.
>
>     https://trac.osgeo.org/postgis/ticket/6028
>
>     On Sat, Dec 13, 2025 at 6:28 PM Paul Ramsey
>     <pramsey at cleverelephant.ca> wrote:
>
>         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/20251216/8587a2ef/attachment.htm>


More information about the postgis-users mailing list