Hmm, seems that florican doesn't like this :-(
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=florican&dt=2021-01-20%2023%3A08%3A15
It's a i386 machine running FreeBSD, so not sure what exactly it's picky
about. But when I tried running this under valgrind, I get some strange
failures in the new chunk in ExecInitModifyTable:
/*
* Determine if the FDW supports batch insert and determine the batch
* size (a FDW may support batching, but it may be disabled for the
* server/table).
*/
if (!resultRelInfo->ri_usesFdwDirectModify &&
operation == CMD_INSERT &&
resultRelInfo->ri_FdwRoutine != NULL &&
resultRelInfo->ri_FdwRoutine->GetForeignModifyBatchSize &&
resultRelInfo->ri_FdwRoutine->ExecForeignBatchInsert)
resultRelInfo->ri_BatchSize =
resultRelInfo->ri_FdwRoutine->GetForeignModifyBatchSize(resultRelInfo);
else
resultRelInfo->ri_BatchSize = 1;
Assert(resultRelInfo->ri_BatchSize >= 1);
It seems as if the resultRelInfo is not initialized, or something like
that. I wouldn't be surprised if the 32-bit machine was pickier and
failing because of that.
A sample of the valgrind log is attached. It's pretty much just
repetitions of these three reports.
regards
--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
==186005== Invalid read of size 1
==186005== at 0x759C12: ExecInitModifyTable (nodeModifyTable.c:2801)
==186005== by 0x720B35: ExecInitNode (execProcnode.c:174)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x9495B1: ProcessQuery (pquery.c:155)
==186005== by 0x94AF24: PortalRunMulti (pquery.c:1267)
==186005== by 0x94A4C8: PortalRun (pquery.c:779)
==186005== by 0x94438E: exec_simple_query (postgres.c:1240)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005== Address 0xe594f78 is 1,864 bytes inside a block of size 8,192 alloc'd
==186005== at 0x483A809: malloc (vg_replace_malloc.c:307)
==186005== by 0xAFEFE6: AllocSetContextCreateInternal (aset.c:468)
==186005== by 0x7298F9: CreateExprContextInternal (execUtils.c:252)
==186005== by 0x7299DD: CreateExprContext (execUtils.c:302)
==186005== by 0x729C5E: ExecAssignExprContext (execUtils.c:481)
==186005== by 0x75D24D: ExecInitSeqScan (nodeSeqscan.c:147)
==186005== by 0x720BEF: ExecInitNode (execProcnode.c:207)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x949E64: PortalStart (pquery.c:505)
==186005== by 0x9442A2: exec_simple_query (postgres.c:1201)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005==
{
<insert_a_suppression_name_here>
Memcheck:Addr1
fun:ExecInitModifyTable
fun:ExecInitNode
fun:InitPlan
fun:standard_ExecutorStart
fun:ExecutorStart
fun:ProcessQuery
fun:PortalRunMulti
fun:PortalRun
fun:exec_simple_query
fun:PostgresMain
fun:BackendRun
fun:BackendStartup
fun:ServerLoop
fun:PostmasterMain
fun:main
}
==186005== Invalid write of size 4
==186005== at 0x759C74: ExecInitModifyTable (nodeModifyTable.c:2809)
==186005== by 0x720B35: ExecInitNode (execProcnode.c:174)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x9495B1: ProcessQuery (pquery.c:155)
==186005== by 0x94AF24: PortalRunMulti (pquery.c:1267)
==186005== by 0x94A4C8: PortalRun (pquery.c:779)
==186005== by 0x94438E: exec_simple_query (postgres.c:1240)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005== Address 0xe594f80 is 1,872 bytes inside a block of size 8,192 alloc'd
==186005== at 0x483A809: malloc (vg_replace_malloc.c:307)
==186005== by 0xAFEFE6: AllocSetContextCreateInternal (aset.c:468)
==186005== by 0x7298F9: CreateExprContextInternal (execUtils.c:252)
==186005== by 0x7299DD: CreateExprContext (execUtils.c:302)
==186005== by 0x729C5E: ExecAssignExprContext (execUtils.c:481)
==186005== by 0x75D24D: ExecInitSeqScan (nodeSeqscan.c:147)
==186005== by 0x720BEF: ExecInitNode (execProcnode.c:207)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x949E64: PortalStart (pquery.c:505)
==186005== by 0x9442A2: exec_simple_query (postgres.c:1201)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005==
{
<insert_a_suppression_name_here>
Memcheck:Addr4
fun:ExecInitModifyTable
fun:ExecInitNode
fun:InitPlan
fun:standard_ExecutorStart
fun:ExecutorStart
fun:ProcessQuery
fun:PortalRunMulti
fun:PortalRun
fun:exec_simple_query
fun:PostgresMain
fun:BackendRun
fun:BackendStartup
fun:ServerLoop
fun:PostmasterMain
fun:main
}
==186005== Invalid read of size 4
==186005== at 0x759C7F: ExecInitModifyTable (nodeModifyTable.c:2811)
==186005== by 0x720B35: ExecInitNode (execProcnode.c:174)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x9495B1: ProcessQuery (pquery.c:155)
==186005== by 0x94AF24: PortalRunMulti (pquery.c:1267)
==186005== by 0x94A4C8: PortalRun (pquery.c:779)
==186005== by 0x94438E: exec_simple_query (postgres.c:1240)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005== Address 0xe594f80 is 1,872 bytes inside a block of size 8,192 alloc'd
==186005== at 0x483A809: malloc (vg_replace_malloc.c:307)
==186005== by 0xAFEFE6: AllocSetContextCreateInternal (aset.c:468)
==186005== by 0x7298F9: CreateExprContextInternal (execUtils.c:252)
==186005== by 0x7299DD: CreateExprContext (execUtils.c:302)
==186005== by 0x729C5E: ExecAssignExprContext (execUtils.c:481)
==186005== by 0x75D24D: ExecInitSeqScan (nodeSeqscan.c:147)
==186005== by 0x720BEF: ExecInitNode (execProcnode.c:207)
==186005== by 0x716F99: InitPlan (execMain.c:939)
==186005== by 0x715F47: standard_ExecutorStart (execMain.c:266)
==186005== by 0x715CD3: ExecutorStart (execMain.c:148)
==186005== by 0x949E64: PortalStart (pquery.c:505)
==186005== by 0x9442A2: exec_simple_query (postgres.c:1201)
==186005== by 0x9485F5: PostgresMain (postgres.c:4394)
==186005== by 0x88D1D4: BackendRun (postmaster.c:4484)
==186005== by 0x88CB53: BackendStartup (postmaster.c:4206)
==186005== by 0x889205: ServerLoop (postmaster.c:1730)
==186005== by 0x888AD0: PostmasterMain (postmaster.c:1402)
==186005== by 0x78D466: main (main.c:209)
==186005==
{
<insert_a_suppression_name_here>
Memcheck:Addr4
fun:ExecInitModifyTable
fun:ExecInitNode
fun:InitPlan
fun:standard_ExecutorStart
fun:ExecutorStart
fun:ProcessQuery
fun:PortalRunMulti
fun:PortalRun
fun:exec_simple_query
fun:PostgresMain
fun:BackendRun
fun:BackendStartup
fun:ServerLoop
fun:PostmasterMain
fun:main
}