Ticket #1697 (closed defect: fixed)
Crash in GiST index with empty MultiPolygons
|Reported by:||realityexists||Owned by:||pramsey|
2.0.0 rev 9517, 32-bit, PostgreSQL 9.1.3
I have a table with a geography(MultiPolygon?) column and a GiST index on that column. For each new row my application initially inserts 'MULTIPOLYGON EMPTY' into that column, then updates it to the real (non-empty) value. After some number of successful inserts any further inserts crash with the attached stack trace. If I insert a different dummy polygon (not empty) everything works fine.
I wasn't able to create a simple repro for this, so I suspect it takes some amount of data for the index to get into a bad state. The stack trace is from Linux, but this also happens on Windows (beta 3 binaries).
The client gets messages like this when trying to insert another value (once a crash has occurred):
NOTICE: [geography_inout.c:gserialized_geography_from_lwgeom:117] typmod was -1 LINE 22: ...(E'SA')), ((E'FL')), ((245)), ((E'MULTIPOL... ^ NOTICE: [gserialized_typmod.c:postgis_valid_typmod:115] Entered function NOTICE: [gserialized_typmod.c:postgis_valid_typmod:120] Got geom(type = 6, srid = 4326, hasz = 0, hasm = 0) NOTICE: [gserialized_typmod.c:postgis_valid_typmod:121] Got typmod(type = 6, srid = 4326, hasz = 0, hasm = 0) NOTICE: [gserialized_gist_nd.c:gserialized_gist_compress:488] [GIST] 'compress' function called NOTICE: [gserialized_gist_nd.c:gserialized_gist_compress:500] [GIST] processing leafkey input NOTICE: [gserialized_gist.c:gserialized_datum_get_gidx_p:241] entered function NOTICE: [gserialized_gist.c:gserialized_datum_get_gidx_p:250] got flags 8 NOTICE: [gserialized_gist.c:gserialized_datum_get_gidx_p:270] could not calculate bbox, returning failure NOTICE: [gserialized_gist_nd.c:gserialized_gist_compress:522] [GIST] empty geometry! NOTICE: [gserialized_gist_nd.c:gserialized_gist_picksplit:1016] [GIST] 'picksplit' function called ********** Error **********