Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtCF2-0006s5-Kb for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 12:30:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dtCF2-0006CU-2r for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 12:30:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtCEy-00069f-Vy for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 12:30:33 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dtCEq-00019N-EZ for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 12:30:32 +0000 Received: by mail-wm0-x230.google.com with SMTP id 13so13448849wmq.2 for ; Sat, 16 Sep 2017 05:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=eP697SWdRtcKJ+1PBGR02ghm7E0ph0Z0XuZXxNylPKA=; b=nirKAnq3rbDSutivxD+bunRLWE8Lk/6G64wyoy2j/s+rKoqJ1wGNqBvhMR50v7l1Gu 3AChtw7RLIkGoW7GyWR21lQuuhDyWa14R6Zu+2fkdNwjt230xmyHO7DwD5X7Z8OM+91Y d9eoK3xpV7zniJeKP12EKFiuYs5FfR6jRFZ+SKyA7dECONfFRvpBlKMmov6oOAJEfedR oBDXisxNgY7B5HnYMM7Gwk0UyB3iyLbaQv9G6D/Uig8FCSt+jmJR9LyxrNYFqiwazgtk CicV4CjvWHe3eDD59eVSy3aHNg7jd9KE3zId0zV/j0WexcJivljhN0olk22QWGKaAK3e 4Qnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=eP697SWdRtcKJ+1PBGR02ghm7E0ph0Z0XuZXxNylPKA=; b=bQuaSVCGoaIVoIKhRIrPhE1xDKgDmp/gZO+/WRj2m+rgeP0tR24QpLtcLW6IC7Doo3 mhczqjcAabeWX/txsSdLcVSiZN00Zq3SrNUUwBjj/IrXT5H5CsoDQrkAx1soKZ7bWmYY EklOEtrWjnMp1MwpFrh2qywKPA6TSOmE97IPJ1ehLIIO5t2AbjQ0dz10cWP4nUy+UYjD QEYwx/IcJH9p6RzccKs8AWR+QgPjRdRYUXFe2N/kMa0iyEfEfWcIW569g7q8c6DrFti0 pr6XQEwqVp/z0u1/f96leeQeOpj3kZFyQBWU3CMyb7mx3J89GUGqsRHsCShPS/1Mxd0g eAhg== X-Gm-Message-State: AHPjjUjC765Fo5swGRYfipcj1PhNXVtmebNgMjUlE4tAiuEH2yT4MLvv 4uOFnD/t4rKucxjUGwBiGupcb30L7W+/gfQofUtTdSLyt+Xp5FOMzEpIjGUNMzNc8C3mX5FzOjU L+1bDR/SY3nkshbpksG1Pdfq/gSzYuEloG63d81Vek/3G274XtWnHQlyne4fBuvBpnZUD/1A2w7 4= X-Google-Smtp-Source: AOwi7QCv4uRQPff3cDs1ws8/hiP04dNqKTVhKhuNexZyD+TkZcZkFNCmNSHSfIDAMENp7CPznE2qUg== X-Received: by 10.28.74.89 with SMTP id x86mr4968860wma.57.1505565022565; Sat, 16 Sep 2017 05:30:22 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id k9sm3660621wrk.27.2017.09.16.05.30.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Sep 2017 05:30:21 -0700 (PDT) To: pgsql-hackers From: Tomas Vondra Subject: valgrind vs. shared typmod registry Message-ID: Date: Sat, 16 Sep 2017 14:30:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9D75F50018534CAA68740A2C" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------9D75F50018534CAA68740A2C Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------9D75F50018534CAA68740A2C Content-Type: text/x-log; name="valgrind.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="valgrind.log" ==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== { 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== { 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== { 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 } --------------9D75F50018534CAA68740A2C Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------9D75F50018534CAA68740A2C--