Opened 2 years ago
Closed 2 years ago
#5173 closed defect (fixed)
st_asflatgeobuf detoast crash
Reported by: | robe | Owned by: | pramsey |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 3.2.2 |
Component: | postgis | Version: | 3.2.x |
Keywords: | Cc: |
Description
Noted on postgis dev mailing list: https://lists.osgeo.org/pipermail/postgis-devel/2022-June/029687.html
and patch at
https://lists.osgeo.org/pipermail/postgis-devel/2022-June/029689.html
Hi, On Sat, Jun 18, 2022 at 06:52:10AM -0500, Justin Pryzby wrote: > An instance running pg15beta1 crashed while running one of sqlsmith's appalling > queries. I reproduced with this, simplified query: > > select st_asflatgeobuf(row(1), false, '') > over () from information_schema.table_privileges > > Program terminated with signal 11, Segmentation fault. > #0 pg_detoast_datum_copy (datum=0x514) at fmgr.c:1719 All versions of st_asflatgeobuf have the same problem, so you can reduce the reproducer to: select st_asflatgeobuf(row(1)) from pg_class; AFAICT, inspect_table() doesn't check that a geometry column was indeed found, leading to the problem. Some like that fixes the crash for me: diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c index 1b502e546..545442f31 100644 --- a/postgis/flatgeobuf.c +++ b/postgis/flatgeobuf.c @@ -110,6 +110,9 @@ static void inspect_table(struct flatgeobuf_agg_ctx *ctx) columns_size++; } + if (!geom_found) + elog(ERROR, "no geom column found"); + if (columns_size > 0) { ctx->ctx->columns = columns; ctx->ctx->columns_size = columns_size;
Attachments (1)
Change History (6)
comment:1 by , 2 years ago
comment:5 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
by , 2 years ago
Attachment: | v1-0001-Fix-ST_AsFlatGeobuf-with-rows-that-doesn-t-contai.patch added |
---|
Note:
See TracTickets
for help on using tickets.
Proper patch sent at https://lists.osgeo.org/pipermail/postgis-devel/2022-June/029694.html.