Hi,

I've been running some regression tests under valgrind, and it seems
select_parallel triggers some uses of uninitialized values in dshash. If
I'm reading the reports right, it complains about hashtable->size_log2
being not being initialized in ensure_valid_bucket_pointers.

I've been running tests under valgrind not too long ago and I don't
recall such failures, so perhaps something broke it in the past few days.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
==18897== Conditional jump or move depends on uninitialised value(s)
==18897==    at 0x6C0B4F: ensure_valid_bucket_pointers (dshash.c:752)
==18897==    by 0x6C0123: dshash_find (dshash.c:390)
==18897==    by 0x971224: find_or_make_matching_shared_tupledesc (typcache.c:2265)
==18897==    by 0x9704E7: assign_record_type_typmod (typcache.c:1602)
==18897==    by 0x68879E: BlessTupleDesc (execTuples.c:1036)
==18897==    by 0x6721C8: ExecInitExprRec (execExpr.c:1512)
==18897==    by 0x671E62: ExecInitExprRec (execExpr.c:1385)
==18897==    by 0x66FC87: ExecInitExpr (execExpr.c:130)
==18897==    by 0x15AB9E92: exec_eval_simple_expr (pl_exec.c:5584)
==18897==    by 0x15AB95E9: exec_eval_expr (pl_exec.c:5202)
==18897==    by 0x15AB4388: exec_stmt_return (pl_exec.c:2755)
==18897==    by 0x15AB2563: exec_stmt (pl_exec.c:1606)
==18897==    by 0x15AB2306: exec_stmts (pl_exec.c:1521)
==18897==    by 0x15AB21B1: exec_stmt_block (pl_exec.c:1459)
==18897==    by 0x15AB046B: plpgsql_exec_function (pl_exec.c:464)
==18897==    by 0x15AAACCD: plpgsql_call_handler (pl_handler.c:258)
==18897==    by 0x674C7E: ExecInterpExpr (execExprInterp.c:650)
==18897==    by 0x6AA6A0: ExecEvalExprSwitchContext (executor.h:309)
==18897==    by 0x6AA709: ExecProject (executor.h:343)
==18897==    by 0x6AA878: ExecResult (nodeResult.c:136)
==18897==  Uninitialised value was created by a heap allocation
==18897==    at 0x9A837E: palloc (mcxt.c:871)
==18897==    by 0x6BFEEA: dshash_attach (dshash.c:269)
==18897==    by 0x9707F7: SharedRecordTypmodRegistryAttach (typcache.c:1778)
==18897==    by 0x484826: AttachSession (session.c:183)
==18897==    by 0x504225: ParallelWorkerMain (parallel.c:1100)
==18897==    by 0x7820B5: StartBackgroundWorker (bgworker.c:835)
==18897==    by 0x793F9E: do_start_bgworker (postmaster.c:5686)
==18897==    by 0x7942D7: maybe_start_bgworkers (postmaster.c:5890)
==18897==    by 0x793399: sigusr1_handler (postmaster.c:5079)
==18897==    by 0x4E4B5CF: ??? (in /usr/lib64/libpthread-2.24.so)
==18897==    by 0x586AC72: __select_nocancel (in /usr/lib64/libc-2.24.so)
==18897==    by 0x78F220: ServerLoop (postmaster.c:1720)
==18897==    by 0x78E9C5: PostmasterMain (postmaster.c:1364)
==18897==    by 0x6D5714: main (main.c:228)
==18897== 
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:ensure_valid_bucket_pointers
   fun:dshash_find
   fun:find_or_make_matching_shared_tupledesc
   fun:assign_record_type_typmod
   fun:BlessTupleDesc
   fun:ExecInitExprRec
   fun:ExecInitExprRec
   fun:ExecInitExpr
   fun:exec_eval_simple_expr
   fun:exec_eval_expr
   fun:exec_stmt_return
   fun:exec_stmt
   fun:exec_stmts
   fun:exec_stmt_block
   fun:plpgsql_exec_function
   fun:plpgsql_call_handler
   fun:ExecInterpExpr
   fun:ExecEvalExprSwitchContext
   fun:ExecProject
   fun:ExecResult
}
==18897== Conditional jump or move depends on uninitialised value(s)
==18897==    at 0x6C0B4F: ensure_valid_bucket_pointers (dshash.c:752)
==18897==    by 0x6C024E: dshash_find_or_insert (dshash.c:440)
==18897==    by 0x971310: find_or_make_matching_shared_tupledesc (typcache.c:2294)
==18897==    by 0x9704E7: assign_record_type_typmod (typcache.c:1602)
==18897==    by 0x68879E: BlessTupleDesc (execTuples.c:1036)
==18897==    by 0x6721C8: ExecInitExprRec (execExpr.c:1512)
==18897==    by 0x671E62: ExecInitExprRec (execExpr.c:1385)
==18897==    by 0x66FC87: ExecInitExpr (execExpr.c:130)
==18897==    by 0x15AB9E92: exec_eval_simple_expr (pl_exec.c:5584)
==18897==    by 0x15AB95E9: exec_eval_expr (pl_exec.c:5202)
==18897==    by 0x15AB4388: exec_stmt_return (pl_exec.c:2755)
==18897==    by 0x15AB2563: exec_stmt (pl_exec.c:1606)
==18897==    by 0x15AB2306: exec_stmts (pl_exec.c:1521)
==18897==    by 0x15AB21B1: exec_stmt_block (pl_exec.c:1459)
==18897==    by 0x15AB046B: plpgsql_exec_function (pl_exec.c:464)
==18897==    by 0x15AAACCD: plpgsql_call_handler (pl_handler.c:258)
==18897==    by 0x674C7E: ExecInterpExpr (execExprInterp.c:650)
==18897==    by 0x6AA6A0: ExecEvalExprSwitchContext (executor.h:309)
==18897==    by 0x6AA709: ExecProject (executor.h:343)
==18897==    by 0x6AA878: ExecResult (nodeResult.c:136)
==18897==  Uninitialised value was created by a heap allocation
==18897==    at 0x9A837E: palloc (mcxt.c:871)
==18897==    by 0x6BFEEA: dshash_attach (dshash.c:269)
==18897==    by 0x970820: SharedRecordTypmodRegistryAttach (typcache.c:1782)
==18897==    by 0x484826: AttachSession (session.c:183)
==18897==    by 0x504225: ParallelWorkerMain (parallel.c:1100)
==18897==    by 0x7820B5: StartBackgroundWorker (bgworker.c:835)
==18897==    by 0x793F9E: do_start_bgworker (postmaster.c:5686)
==18897==    by 0x7942D7: maybe_start_bgworkers (postmaster.c:5890)
==18897==    by 0x793399: sigusr1_handler (postmaster.c:5079)
==18897==    by 0x4E4B5CF: ??? (in /usr/lib64/libpthread-2.24.so)
==18897==    by 0x586AC72: __select_nocancel (in /usr/lib64/libc-2.24.so)
==18897==    by 0x78F220: ServerLoop (postmaster.c:1720)
==18897==    by 0x78E9C5: PostmasterMain (postmaster.c:1364)
==18897==    by 0x6D5714: main (main.c:228)
==18897== 
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:ensure_valid_bucket_pointers
   fun:dshash_find_or_insert
   fun:find_or_make_matching_shared_tupledesc
   fun:assign_record_type_typmod
   fun:BlessTupleDesc
   fun:ExecInitExprRec
   fun:ExecInitExprRec
   fun:ExecInitExpr
   fun:exec_eval_simple_expr
   fun:exec_eval_expr
   fun:exec_stmt_return
   fun:exec_stmt
   fun:exec_stmts
   fun:exec_stmt_block
   fun:plpgsql_exec_function
   fun:plpgsql_call_handler
   fun:ExecInterpExpr
   fun:ExecEvalExprSwitchContext
   fun:ExecProject
   fun:ExecResult
}
==18657== Conditional jump or move depends on uninitialised value(s)
==18657==    at 0x6C0B4F: ensure_valid_bucket_pointers (dshash.c:752)
==18657==    by 0x6C0123: dshash_find (dshash.c:390)
==18657==    by 0x970145: lookup_rowtype_tupdesc_internal (typcache.c:1436)
==18657==    by 0x97024A: lookup_rowtype_tupdesc (typcache.c:1490)
==18657==    by 0x8F7079: record_out (rowtypes.c:321)
==18657==    by 0x97C5DE: FunctionCall1Coll (fmgr.c:1037)
==18657==    by 0x97DD00: OutputFunctionCall (fmgr.c:1669)
==18657==    by 0x48167E: printtup (printtup.c:356)
==18657==    by 0x67F54C: ExecutePlan (execMain.c:1755)
==18657==    by 0x67D4EC: standard_ExecutorRun (execMain.c:363)
==18657==    by 0x67D38D: ExecutorRun (execMain.c:306)
==18657==    by 0x822A24: PortalRunSelect (pquery.c:932)
==18657==    by 0x8226FE: PortalRun (pquery.c:773)
==18657==    by 0x81CBEF: exec_simple_query (postgres.c:1109)
==18657==    by 0x820C29: PostgresMain (postgres.c:4106)
==18657==    by 0x793216: BackendRun (postmaster.c:4360)
==18657==    by 0x7929B0: BackendStartup (postmaster.c:4032)
==18657==    by 0x78F348: ServerLoop (postmaster.c:1756)
==18657==    by 0x78E9C5: PostmasterMain (postmaster.c:1364)
==18657==    by 0x6D5714: main (main.c:228)
==18657==  Uninitialised value was created by a heap allocation
==18657==    at 0x9A837E: palloc (mcxt.c:871)
==18657==    by 0x6BFC82: dshash_create (dshash.c:202)
==18657==    by 0x9705DD: SharedRecordTypmodRegistryInit (typcache.c:1670)
==18657==    by 0x4846D0: GetSessionDsmHandle (session.c:127)
==18657==    by 0x5027B5: InitializeParallelDSM (parallel.c:222)
==18657==    by 0x682E12: ExecInitParallelPlan (execParallel.c:510)
==18657==    by 0x69832E: ExecGather (nodeGather.c:159)
==18657==    by 0x684522: ExecProcNodeFirst (execProcnode.c:436)
==18657==    by 0x68E1CF: ExecProcNode (executor.h:251)
==18657==    by 0x68E5B0: fetch_input_tuple (nodeAgg.c:689)
==18657==    by 0x690EDD: agg_retrieve_direct (nodeAgg.c:2318)
==18657==    by 0x690B2F: ExecAgg (nodeAgg.c:2129)
==18657==    by 0x684522: ExecProcNodeFirst (execProcnode.c:436)
==18657==    by 0x67D048: ExecProcNode (executor.h:251)
==18657==    by 0x67F4DF: ExecutePlan (execMain.c:1720)
==18657==    by 0x67D4EC: standard_ExecutorRun (execMain.c:363)
==18657==    by 0x67D38D: ExecutorRun (execMain.c:306)
==18657==    by 0x822A24: PortalRunSelect (pquery.c:932)
==18657==    by 0x8226FE: PortalRun (pquery.c:773)
==18657==    by 0x81CBEF: exec_simple_query (postgres.c:1109)
==18657== 
{
   <insert_a_suppression_name_here>
   Memcheck:Cond
   fun:ensure_valid_bucket_pointers
   fun:dshash_find
   fun:lookup_rowtype_tupdesc_internal
   fun:lookup_rowtype_tupdesc
   fun:record_out
   fun:FunctionCall1Coll
   fun:OutputFunctionCall
   fun:printtup
   fun:ExecutePlan
   fun:standard_ExecutorRun
   fun:ExecutorRun
   fun:PortalRunSelect
   fun:PortalRun
   fun:exec_simple_query
   fun:PostgresMain
   fun:BackendRun
   fun:BackendStartup
   fun:ServerLoop
   fun:PostmasterMain
   fun:main
}
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to