(gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x0000561e38427e1c in freeScanStackEntry (stackEntry=0x561e396ef718, so=) at ./build/../src/backend/access/spgist/spgscan.c:47 #2 0x0000561e38428a6e in freeScanStack (so=0x561e396ed508) at ./build/../src/backend/access/spgist/spgscan.c:60 #3 resetSpGistScanOpaque (so=0x561e396ed508) at ./build/../src/backend/access/spgist/spgscan.c:75 #4 spgrescan (scan=, scankey=0x561e3969eab8, nscankeys=, orderbys=, norderbys=) at ./build/../src/backend/access/spgist/spgscan.c:229 #5 0x0000561e385803c2 in ExecReScanIndexScan (node=node@entry=0x561e39624408) at ./build/../src/backend/executor/nodeIndexscan.c:603 #6 0x0000561e38557bfb in ExecReScan (node=node@entry=0x561e39624408) at ./build/../src/backend/executor/execAmi.c:181 #7 0x0000561e38582944 in ExecProcNode (node=0x561e39624408) at ./build/../src/include/executor/executor.h:235 #8 ExecLimit (pstate=0x561e3969b230) at ./build/../src/backend/executor/nodeLimit.c:95 #9 0x0000561e38589256 in ExecProcNode (node=0x561e3969b230) at ./build/../src/include/executor/executor.h:237 #10 ExecNestLoop (pstate=0x561e39699af0) at ./build/../src/backend/executor/nodeNestloop.c:160 #11 0x0000561e38589256 in ExecProcNode (node=0x561e39699af0) at ./build/../src/include/executor/executor.h:237 #12 ExecNestLoop (pstate=0x561e395f6db8) at ./build/../src/backend/executor/nodeNestloop.c:160 #13 0x0000561e3858b95e in ExecProcNode (node=0x561e395f6db8) at ./build/../src/include/executor/executor.h:237 #14 ExecSort (pstate=0x561e395f6ca8) at ./build/../src/backend/executor/nodeSort.c:107 #15 0x0000561e385728fc in ExecProcNode (node=0x561e395f6ca8) at ./build/../src/include/executor/executor.h:237 #16 fetch_input_tuple (aggstate=aggstate@entry=0x561e395f6840) at ./build/../src/backend/executor/nodeAgg.c:406 #17 0x0000561e385744ed in agg_retrieve_direct (aggstate=0x561e395f6840) at ./build/../src/backend/executor/nodeAgg.c:1736 #18 ExecAgg (pstate=0x561e395f6840) at ./build/../src/backend/executor/nodeAgg.c:1551 #19 0x0000561e38563513 in ExecProcNode (node=0x561e395f6840) at ./build/../src/include/executor/executor.h:237 #20 ExecutePlan (execute_once=, dest=0x7fbea4973668, direction=, numberTuples=0, sendTuples=, operation=CMD_SELECT, use_parallel_mode=, planstate=0x561e395f6840, estate=0x561e395f65e0) at ./build/../src/backend/executor/execMain.c:1721 #21 standard_ExecutorRun (queryDesc=0x561e395f9690, direction=, count=0, execute_once=) at ./build/../src/backend/executor/execMain.c:362 #22 0x00007fbe9c48ce15 in pgss_ExecutorRun (queryDesc=0x561e395f9690, direction=ForwardScanDirection, count=0, execute_once=) at ./build/../contrib/pg_stat_statements/pg_stat_statements.c:892 #23 0x0000561e386b800b in PortalRunSelect (portal=portal@entry=0x561e39565da0, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x7fbea4973668) at ./build/../src/backend/tcop/pquery.c:932 #24 0x0000561e386b95a0 in PortalRun (portal=portal@entry=0x561e39565da0, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x7fbea4973668, altdest=altdest@entry=0x7fbea4973668, completionTag=0x7fff1e5b99f0 "") at ./build/../src/backend/tcop/pquery.c:773 #25 0x0000561e386b5239 in exec_simple_query ( query_string=0x561e394ed0d0 "SELECT\r\n b.idhu, layer, max(dba)\r\nFROM\r\n (SELECT b.\"IDHU\" AS idhu, first(geom) AS geom FROM do_buildings b JOIN do_ data d ON b.\"IDHU\"::text = d.\"IDHU\"::text GROUP BY 1 LIMIT 100) b\r\nCROSS JOIN u"...) at ./build/../src/backend/tcop/postgres.c:1122 #26 0x0000561e386b7093 in PostgresMain (argc=, argv=argv@entry=0x561e39533bc0, dbname=, username=) ---Type to continue, or q to quit--- backend/tcop/postgres.c:4153 #27 0x0000561e383c5aba in BackendRun (port=0x561e3952aa70) at ./build/../src/backend/postmaster/postmaster.c:4361 #28 BackendStartup (port=0x561e3952aa70) at ./build/../src/backend/postmaster/postmaster.c:4033 #29 ServerLoop () at ./build/../src/backend/postmaster/postmaster.c:1706 #30 0x0000561e38642713 in PostmasterMain (argc=5, argv=0x561e394e8e10) at ./build/../src/backend/postmaster/postmaster.c:1379 #31 0x0000561e383c6fb4 in main (argc=5, argv=0x561e394e8e10) at ./build/../src/backend/main/main.c:228