Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kS42b-0001Zf-S8 for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Oct 2020 20:03:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kS42a-0003s3-De for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Oct 2020 20:03:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kS42a-0003rq-7p for pgsql-bugs@lists.postgresql.org; Mon, 12 Oct 2020 20:03:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kS42X-0003Zb-8R for pgsql-bugs@lists.postgresql.org; Mon, 12 Oct 2020 20:03:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 09CK3AHv3249981; Mon, 12 Oct 2020 16:03:10 -0400 From: Tom Lane To: Pavel Borisov cc: Heikki Linnakangas , Alexander Lakhin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering In-reply-to: References: <16329-7a6aa9b6fa1118a1@postgresql.org> <3dda6945-c147-5afc-7720-38ec6848dafa@gmail.com> <10261.1588705157@sss.pgh.pa.us> <93ca4540-0016-8217-2b31-535613499987@gmail.com> <06f117b8-bbc1-4190-d204-ef329121cbca@gmail.com> Comments: In-reply-to Pavel Borisov message dated "Mon, 12 Oct 2020 20:03:28 +0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3249979.1602532990.1@sss.pgh.pa.us> Date: Mon, 12 Oct 2020 16:03:10 -0400 Message-ID: <3249980.1602532990@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Borisov writes: >> I investigated this issue under Valgrind and found that in v13 it is no >> longer detected and the patch in the discussion above is no longer needed. > I want to correct myself that issue is no longer detected in master, but > not in 13stable. Everything else is without changes. I went to try to evaluate this, and found that with or without your proposed testing addition, the code coverage for gistbuildbuffers.c remains at 0.0%. The previous testing patch is the same. So that's why the issue is "no longer detectable": the code is not reached in HEAD. After some investigation, I found that commit 16fa9b2b3 broke this: if the opclass(es) have GIST_SORTSUPPORT_PROC, then the buffering code will not be used, no matter what the index's options say. This seems like a spectacularly bad idea from a testing standpoint, even if it's the right thing for most users. Basically, it is now impossible to test buffering builds at all, unless you find a gist opclass that lacks GIST_SORTSUPPORT_PROC. Although there are a few candidates to pick from, someone could at any time add such a support proc and silently break your testing plan, just as 16fa9b2b3 did by adding such a proc to point_ops. So I think 16fa9b2b3 has to be reconsidered: if we have a buffering=on index parameter, we must go with that independently of the availability of sort support procs. Unless I hear very loud squawks very quickly, I'll go make that happen. (I observe that 16fa9b2b3 also failed to update the relevant documentation in 65.4.1...) regards, tom lane