gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

invalid memory alloc request size xxx (context 'ExecutorState') (mcxt.c:1357) (mcxt.c:571)

Open cobolbaby opened this issue 2 years ago • 3 comments

Bug Report

It seems to be a memory bug caused by auto_explain.

Greenplum version or build

  • 6.24.4

OS version and uname -a

autoconf options used ( config.status --config )

Installation information ( pg_config )

Expected behavior

Actual behavior

2023-09-11 12:29:54.334424 CST,"gpadmin","F3_BDC",p1954429,th1649297536,"192.168.2.12","53028",2023-09-11 12:15:44 CST,210458599,con270637,cmd81,seg-1,,dx2204931,x210458599,sx1,"ERROR","XX000","invalid memory alloc request size 1342177280 (context 'ExecutorState') (mcxt.c:1357) (mcxt.c:571)  (seg6 slice5 172.17.239.140:40002 pid=491462) (mcxt.c:571)",,,,,"SQL statement ""create temp table tp_sno as
select distinct a.sno,
(case when c.sno is not null then c.sno
when b.sno is not null then b.sno
else a.sno end) final_sno
from raw_data a
left join batwo.mds_sno_parts b
on a.sno=b.scansn
and b.status='1' and b.wc in('40','M40')
left join batwo.mds_sno_parts c
on b.sno=c.scansn
and c.status='1' and c.wc in('40','M40')""
PL/pgSQL function dw_batwo.func_insert_shipment_machine_history() line 265 at SQL statement
SQL statement ""SELECT dw_batwo.func_insert_shipment_machine_history()""
PL/pgSQL function dw_batwo.func_insert_shipment_machine() line 6 at PERFORM","select dw_batwo.func_insert_shipment_machine()",0,,"mcxt.c",571,"Stack trace:
1    0xbffdcc postgres errstart (elog.c:557)
2    0xc033a5 postgres ThrowErrorData (elog.c:1971)
3    0x8da853 postgres mppExecutorFinishup (execUtils.c:2814)
4    0x8c1ea3 postgres standard_ExecutorEnd (discriminator 2)
5    0x76ed5aefd375 auto_explain.so <symbol not found> + 0x5aefd375
6    0x840275 postgres ExecCreateTableAs (createas.c:452)
7    0xa9edd1 postgres <symbol not found> (utility.c:1649)
8    0xa9dd45 postgres standard_ProcessUtility (utility.c:1054)
9    0x76ed5b17ac4d metrics_collector.so AdaptorProcessUtility + 0x72
10   0x76ed5b17af95 metrics_collector.so EmitUtilityQueryInfo + 0x345
11   0x904462 postgres <symbol not found> (spi.c:2341)
12   0x904e38 postgres SPI_execute_plan_with_paramlist (spi.c:2803)
13   0x76eccc9b02dd plpgsql.so <symbol not found> + 0xcc9b02dd
14   0x76eccc9b2a9b plpgsql.so <symbol not found> + 0xcc9b2a9b
15   0x76eccc9b5717 plpgsql.so <symbol not found> + 0xcc9b5717
16   0x76eccc9b5a9d plpgsql.so plpgsql_exec_function + 0x33d
17   0x76eccc9a7911 plpgsql.so plpgsql_call_handler + 0x111
18   0x8cea26 postgres <symbol not found> (execQual.c:2220)
19   0x8d432d postgres ExecProject (execQual.c:6395)
20   0x8f4c9d postgres ExecResult (nodeResult.c:218)
21   0x8c6a68 postgres ExecProcNode (execProcnode.c:970)
22   0x8bda79 postgres <symbol not found> (tuptable.h:159)
23   0x8be79e postgres standard_ExecutorRun (execMain.c:3168)
24   0x76ed5aefd745 auto_explain.so <symbol not found> + 0x5aefd745
25   0x8be947 postgres ExecutorRun (execMain.c:1000)
26   0x90246f postgres <symbol not found> (spi.c:2642)
27   0x90472e postgres <symbol not found> (spi.c:2327)
28   0x904e38 postgres SPI_execute_plan_with_paramlist (spi.c:2803)
29   0x76eccc9ad0e4 plpgsql.so <symbol not found> + 0xcc9ad0e4
30   0x76eccc9b2cf6 plpgsql.so <symbol not found> + 0xcc9b2cf6
"
2023-09-11 12:29:54.334573 CST,"gpadmin","F3_BDC",p1954429,th1649297536,"192.168.2.12","53028",2023-09-11 12:15:44 CST,210458599,con270637,cmd81,seg-1,,dx2204931,x210458599,sx1,"LOG","00000","An exception was encountered during the execution of statement: select dw_batwo.func_insert_shipment_machine()",,,,,,"select dw_batwo.func_insert_shipment_machine()",0,,"elog.c",2155,

Step to reproduce the behavior

cobolbaby avatar Sep 11 '23 04:09 cobolbaby

Similar issue invalid memory alloc request size 18446744073709551613 (mcxt.c:1312) with 6.26.3

2024-04-21 22:48:02.468301 CST,"gpadmin","F6_BDC",p2274946,th532646016,"192.168.2.11","49136",2024-04-21 22:44:27 CST,0,con512921,cmd86,seg16,,dx8384470,,sx1,"ERROR","XX000","invalid memory alloc request size 18446744073709551613 (mcxt.c:1312)",,,,,,"COPY fis.pca_pca_label_print_log TO PROGRAM 'gzip -c -1 | /usr/local/greenplum-db-6.26.3/bin/gpbackup_s3_plugin backup_data /tmp/20240421224344_gpbackup_s3_backup.yml <SEG_DATA_DIR>/backups/20240421/20240421224344/gpbackup_<SEGID>_20240421224344_864318.gz' WITH CSV DELIMITER ',' ON SEGMENT IGNORE EXTERNAL PARTITIONS;",0,,"mcxt.c",1312,"Stack trace:
1    0xc01657 postgres errstart (elog.c:557)
2    0xc044ee postgres elog_finish (elog.c:1728)
3    0x6b4cbc postgres <symbol not found> (mcxt.c:1180)
4    0xc3c5a3 postgres <symbol not found> (mcxt.c:1305)
5    0xbb5ce3 postgres text_to_cstring (discriminator 16)
6    0xc096b8 postgres FunctionCall1Coll (fmgr.c:1317)
7    0xc101d7 postgres OutputFunctionCall (fmgr.c:1969)
8    0x8384ab postgres CopyOneRowTo (copy.c:3309)
9    0x83e9ed postgres <symbol not found> (copy.c:3052)
10   0x83f512 postgres DoCopy (copy.c:1179)
11   0xa9f78d postgres standard_ProcessUtility (utility.c:638)
12   0x7e271888ec4d metrics_collector.so AdaptorProcessUtility + 0x72
13   0x7e271888efc9 metrics_collector.so EmitUtilityQueryInfo + 0x379
14   0xa9bc91 postgres <symbol not found> (palloc.h:174)
15   0xa9c7ae postgres <symbol not found> (pquery.c:1525)
16   0xa9df37 postgres PortalRun (pquery.c:1035)
17   0xa96789 postgres <symbol not found> (postgres.c:1393)
18   0xa9b40a postgres PostgresMain (postgres.c:5489)
19   0x6b3873 postgres <symbol not found> (postmaster.c:4492)
20   0xa1efc6 postgres PostmasterMain (postmaster.c:1517)
21   0x6b7751 postgres main (main.c:205)
22   0x7e271c5a0555 libc.so.6 __libc_start_main + 0xf5
23   0x6c35fc postgres <symbol not found> + 0x6c35fc
"
2024-04-21 22:48:02.468538 CST,"gpadmin","F6_BDC",p2274946,th532646016,"192.168.2.11","49136",2024-04-21 22:44:27 CST,0,con512921,cmd86,seg16,,dx8384470,,sx1,"LOG","00000","An exception was encountered during the execution of statement: COPY fis.pca_pca_label_print_log TO PROGRAM 'gzip -c -1 | /usr/local/greenplum-db-6.26.3/bin/gpbackup_s3_plugin backup_data /tmp/20240421224344_gpbackup_s3_backup.yml <SEG_DATA_DIR>/backups/20240421/20240421224344/gpbackup_<SEGID>_20240421224344_864318.gz' WITH CSV DELIMITER ',' ON SEGMENT IGNORE EXTERNAL PARTITIONS;",,,,,,"COPY fis.pca_pca_label_print_log TO PROGRAM 'gzip -c -1 | /usr/local/greenplum-db-6.26.3/bin/gpbackup_s3_plugin backup_data /tmp/20240421224344_gpbackup_s3_backup.yml <SEG_DATA_DIR>/backups/20240421/20240421224344/gpbackup_<SEGID>_20240421224344_864318.gz' WITH CSV DELIMITER ',' ON SEGMENT IGNORE EXTERNAL PARTITIONS;",0,,"elog.c",2174,

cobolbaby avatar Apr 21 '24 15:04 cobolbaby

Can you share:

  • reproduce steps
  • the error LOG

here?

kainwen avatar Apr 22 '24 00:04 kainwen

Similar issue invalid memory alloc request size 18446744073709551613 (mcxt.c:1312) with 6.26.3

Regarding the issue encountered during gpbackup, it seems to be related to disk bad blocks. After rebuilding the table, gpbackup no longer reports errors. However, I haven't figured out the exact reason and couldn't create a reproducible test case.

cobolbaby avatar Apr 22 '24 01:04 cobolbaby