Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUxfp-0001K5-7p for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 18:47:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iUxfn-00074o-Tp for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Nov 2019 18:47:23 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUxfn-00074h-IK for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 18:47:23 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUxfk-00009h-K1 for pgsql-bugs@lists.postgresql.org; Wed, 13 Nov 2019 18:47:23 +0000 Received: by mail-wr1-x433.google.com with SMTP id l7so3605638wrp.6 for ; Wed, 13 Nov 2019 10:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5V3iCGNktYUITvfcHwR/Dj8+lUCi01XlpnBOGBI6UZ8=; b=KvvRT1XmvK/l7elar4V5iTrE8WQI3P+Ik1G7S4eh0rKy5AwQD+IkoCt0g2zFpxyT2j JDNHrS3GPjVs5KlwtfVXsnfC5WvOY1sYdmGLizg3LNj7NFofLtKz8mY7MwUGHGnJCHXs qJaVZq9jSNESpVQq3R7JntXdjpbv/vKY4QuV+pR1KyQbKexoieYEDRaMbt+XhCGc58QG rNygisQnzD73r6OBgqw+M4pkEjuBWD7U2ab6XaDxFj0zoZokxJlUdxojJMm9rhm0JJJS yrZ6a1SQiKzPBnDA/Z0dassjFVNIqKIsd9a2J4vwd1W/c1AiMB13urGOtHUzpUhCXEfX J7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5V3iCGNktYUITvfcHwR/Dj8+lUCi01XlpnBOGBI6UZ8=; b=A+0nzIPCiDOlEHRC8QEYy+4rvq2LfdGgW/VnLgzUAQtD5dHilcpH3jHfaa5JusxhfO sVY/IR7BA2EPJEZzKpzQqTA4NLb9RPBIAVkcFi8eil3dh5a9LrRaHAwXcGZ+tM89RwbL 46Wln5B+k6mez2Ak7j50GYbHWYWe8iy2ZDA1dHmx4+PGL0QjMoRWGe1U0K/wtRXRUUlA p78hJoIph3C7xIj8Kc99+DdN5lzgoLYVldQkT3nvOEqMfNVcn3oRPR1vHikhGEl8fUxo tFHKPU7aXNgiPyaD16vZ8DGfxZ8XG14hV4Ir0bWEw84SaizenpPw7tB7Nk3lRwyNO2Yv 3JdA== X-Gm-Message-State: APjAAAV5dn6l6ieb2DplfgD/7AWSnN8Iz0dpLvZDMpoCy0TXoHQFWg6A 9tzxWQHpNyJ6eH52laYz2kbAMA== X-Google-Smtp-Source: APXvYqyLKuEGLLbdm1+8eSKonWSyQ3jafh2dmkYbnw9akkaCtQ3P3ge5IpBO3cDlOkRyhTZM+df92Q== X-Received: by 2002:a5d:62cf:: with SMTP id o15mr4171908wrv.7.1573670838761; Wed, 13 Nov 2019 10:47:18 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id x5sm3071643wmj.7.2019.11.13.10.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 10:47:16 -0800 (PST) Date: Wed, 13 Nov 2019 19:47:15 +0100 From: Tomas Vondra To: Ranier Vilela Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: [BUG] Uninitializaed configOut.leafType used. Message-ID: <20191113184715.hgpfvphfx4lw6fwm@development> References: <32631.1573665493@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Nov 13, 2019 at 05:55:40PM +0000, Ranier Vilela wrote: >Hi, >Ok, so all these commands are for what? > > case SPGIST_CONFIG_PROC: > ok = check_amproc_signature(procform->amproc, VOIDOID, true, > 2, 2, INTERNALOID, INTERNALOID); > configIn.attType = procform->amproclefttype; > memset(&configOut, 0, sizeof(configOut)); > > OidFunctionCall2(procform->amproc, > PointerGetDatum(&configIn), > PointerGetDatum(&configOut)); > > configOutLefttype = procform->amproclefttype; > configOutRighttype = procform->amprocrighttype; > > /* > * When leaf and attribute types are the same, compress > * function is not required and we set corresponding bit in > * functionset for later group consistency check. > */ > if (!OidIsValid(configOut.leafType) || > configOut.leafType == configIn.attType) > { > >When case SPGIST_CONFIG_PROC, OidIsValid(configOut.leafType) is tested, >but when case SPGIST_COMPRESS_PROC is fired, OidIsValid(configOut.leafType) is not necessary and configOut.leafType >happy accessed? > >Maybe, the Valgrind paths, didn't have a chance, with case SPGIST_COMPRESS_PROC. > >I review carefully, before send to list and premature judgments, don't help. > That's great, but unfortunately it's useless if you don't explain the reasoning while reporting the issue. Even better if you can provide a reproducer hitting the issue, of course. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services