Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVCC6-00Gad5-NY for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Aug 2023 14:35:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qVCC5-0090Wz-56 for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Aug 2023 14:35:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVCC4-0090Wr-TG for pgsql-bugs@lists.postgresql.org; Sun, 13 Aug 2023 14:35:49 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVCC2-002HRw-PE for pgsql-bugs@lists.postgresql.org; Sun, 13 Aug 2023 14:35:48 +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 37DEZhLV665395; Sun, 13 Aug 2023 10:35:43 -0400 From: Tom Lane To: Alexander Lakhin cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17950: Incorrect memory access in gtsvector_picksplit() In-reply-to: References: <17950-6c80a8d2b94ec695@postgresql.org> Comments: In-reply-to Alexander Lakhin message dated "Sun, 13 Aug 2023 16:00:01 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <665393.1691937343.1@sss.pgh.pa.us> Date: Sun, 13 Aug 2023 10:35:43 -0400 Message-ID: <665394.1691937343@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > I can also propose a regression test addition that demonstrates the valgrind > complaint and also the output of gtsvectorout() for the case ISALLTRUE and > the opposite. OK, but ... > This addition increases the duration of `make check -C contrib/pageinspect` > under valgrind by 7-8 seconds for me: [ ie, more than triple its previous runtime ] ... that seems completely unacceptable cost-wise. I'd be inclined to commit the fix without a supporting test case, instead of that. Given that the misapplication of GETSIGN is causing an incorrect pointer to be passed to sizebitvec(), how come the error is not leading to outright wrong answers? I guess because it's in picksplit, the worst outcome normally is a poor choice of split, so maybe exhibiting wrong behavior in a detectable way is hard. > In absence of any objections or other propositions, I'm inclined to register > this bugfix on the commitfest. Please do that in any case, so we don't forget about it. regards, tom lane