Segment panic with Stack trace like:
(gdb) bt
#0 0x00007f347b09eb8f in raise () from /opt/nfs/vcf_gs_csp_prd_srdata10/35572832.bcm/packcore-coredump-911519/lib64/libpthread.so.0
#1 0x0000000000cf2b98 in StandardHandlerForSigillSigsegvSigbus_OnMainThread (processName=<optimized out>, postgres_signal_arg=11) at elog.c:5104
#2 <signal handler called>
#3 comparetup_heap (a=<optimized out>, b=<optimized out>, state=0x3c117e0) at tuplesort.c:3750
#4 0x0000000000d47062 in qsort_tuple (a=0x7f3451e6f050, n=587138, cmp_tuple=0xd4bdd0 <comparetup_heap>, state=state@entry=0x3c117e0) at qsort_tuple.c:112
#5 0x0000000000d4a1c4 in tuplesort_sort_memtuples (state=0x3c117e0) at tuplesort.c:3536
#6 dumptuples (state=state@entry=0x3c117e0, alltuples=alltuples@entry=true) at tuplesort.c:3147
#7 0x0000000000d4ea30 in tuplesort_performsort (state=state@entry=0x3c117e0) at tuplesort.c:1967
#8 0x000000000098d033 in ExecSort (pstate=0x3a28760) at nodeSort.c:164
#9 0x000000000095c9b7 in ExecProcNodeGPDB (node=0x3a28760) at execProcnode.c:645
#10 0x000000000098d750 in ExecProcNode (node=0x3a28760) at ../../../src/include/executor/executor.h:271
#11 ExecUnique (pstate=0x3a285a0) at nodeUnique.c:74
#12 0x000000000095c9b7 in ExecProcNodeGPDB (node=0x3a285a0) at execProcnode.c:645
#13 0x00000000009a0324 in ExecProcNode (node=0x3a285a0) at ../../../src/include/executor/executor.h:271
#14 execMotionSender (node=0x3a282b0) at nodeMotion.c:227
#15 ExecMotion (pstate=0x3a282b0) at nodeMotion.c:191
#16 0x000000000095c9b7 in ExecProcNodeGPDB (node=0x3a282b0) at execProcnode.c:645
#17 0x000000000095358b in ExecProcNode (node=0x3a282b0) at ../../../src/include/executor/executor.h:271
#18 ExecutePlan (estate=estate@entry=0x3a27880, planstate=0x3a282b0, use_parallel_mode=<optimized out>, operation=operation@entry=CMD_SELECT, sendTuples=sendTuples@entry=false, numberTuples=numberTuples@entry=0,
direction=ForwardScanDirection, dest=0x7f34538775a0, execute_once=false) at execMain.c:2672
#19 0x0000000000953f95 in ExecutePlan (execute_once=false, dest=0x7f34538775a0, direction=ForwardScanDirection, numberTuples=0, sendTuples=false, operation=CMD_SELECT, use_parallel_mode=<optimized out>, planstate=<optimized out>,
estate=0x3a27880) at execMain.c:922
#20 standard_ExecutorRun (queryDesc=0x3a04a10, direction=ForwardScanDirection, count=0, execute_once=<optimized out>) at execMain.c:922
#21 0x0000000000954125 in ExecutorRun (queryDesc=queryDesc@entry=0x3a04a10, direction=direction@entry=ForwardScanDirection, count=count@entry=0, execute_once=<optimized out>) at execMain.c:793
#22 0x0000000000b6c6cc in PortalRunSelect (portal=portal@entry=0x3aa9b60, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x7f34538775a0) at pquery.c:1151
#23 0x0000000000b6e701 in PortalRun (portal=portal@entry=0x3aa9b60, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=<optimized out>, dest=dest@entry=0x7f34538775a0,
altdest=altdest@entry=0x7f34538775a0, completionTag=0x7ffc3f810f90 "") at pquery.c:989
#24 0x0000000000b67466 in exec_mpp_query (
query_string=query_string@entry=0x3b06053 "with zeit as\r\n(select\r\n year(current_date-31) gj\r\n,year(current_date-31)-1 vj\r\n,date((year(current_date-31)-1)::text||'-12-31')ult_vj\r\n)\r\n,bpa as\r\n(\r\n \r\nselect DISTINCT 33::smallint sg,q68t248.ag::bigint*1000000000+q68t248.vsnr as ag_vsnr\r\n,case when prod_nr in(4302,4301)", ' ' <repeats 15 times>, "then '01 EURO-BP-Sach / BP-EG92'\r\n when prod_nr in(5808,5896,5898) then '03 BP-Alt / BP-Glas'\r\n when prod_nr in(5807,5893)", ' ' <repeats 15 times>, "then '04 Kundenschließfach'\r\n when prod_nr in(4702,4797,4707,4710,4416)then '05 Alte BP-Gebäude'\r\n when prod_nr in(4303)", ' ' <repeats 20 times>, "then '16 Vermögenspolice VSV' \r\n when prod_nr in(4304)", ' ' <repeats 20 times>, "then '17 Geno Bankpolice OP-RISK' \r\n when prod_nr in(4305)", ' ' <repeats 20 times>, "then '18 Bankpolice OP-RISK' \r\n else('99 prod_nr'||prod_nr)end::varchar(50) Produkt\r\n,case when prod_nr in(4302,4301,5808,5896,5898,5807,5893)then 'Sach-Inhalt'\r\n else 'Sach' end::varchar(50) Sortierung\r\n,coalesce(t249.avb,'')::varchar(10)avb\r\n,prod_nr\r\n,bil_sum_ig", serializedPlantree=serializedPlantree@entry=0x3b06453 "(\265/\375\240\322z\004", serializedPlantreelen=serializedPlantreelen@entry=22293,
serializedQueryDispatchDesc=serializedQueryDispatchDesc@entry=0x3b0bb68 "(\265/\375\240\356\302\002", serializedQueryDispatchDesclen=serializedQueryDispatchDesclen@entry=23094) at postgres.c:1438
#25 0x0000000000b6bafc in PostgresMain (argc=<optimized out>, argv=argv@entry=0x3a328c0, dbname=<optimized out>, username=<optimized out>) at postgres.c:5577
#26 0x0000000000acb1e4 in BackendRun (port=0x3a0a920, port=0x3a0a920) at postmaster.c:4985
#27 BackendStartup (port=0x3a0a920) at postmaster.c:4662
#28 ServerLoop () at postmaster.c:2016
#29 0x0000000000acc1a7 in PostmasterMain (argc=argc@entry=5, argv=argv@entry=0x39d4280) at postmaster.c:1631
#30 0x00000000006ed104 in main (argc=5, argv=0x39d4280) at main.c:240
The main functions are "qsort_tuple" and "tuplesort_sort_memtuples"
Greenplum 7.2.0 and 7.3.0
Code bug which caused Greenplum to use memory that was already freed.
Code fix is available in Greenplum 7.3.1 and above.