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 1s4U4h-004RvB-0Z for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 23:18:18 +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 1s4U4d-005rXY-0W for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 23:18:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4U4c-005rXP-N2 for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 23:18:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4U4a-001wWG-Ss for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 23:18:14 +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 447NI9qm282082; Tue, 7 May 2024 19:18:09 -0400 From: Tom Lane To: David Rowley cc: Andrew Dunstan , Richard Guo , jian he , PostgreSQL Hackers Subject: Re: Revert: Remove useless self-joins *and* -DREALLOCATE_BITMAPSETS make server crash, regress test fail. In-reply-to: References: <1e6ca7b3-98e6-46b2-9982-97f92c7523d8@dunslane.net> <76910.1715106055@sss.pgh.pa.us> <276516.1715121616@sss.pgh.pa.us> <279607.1715122556@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Wed, 08 May 2024 11:03:16 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <282080.1715123889.1@sss.pgh.pa.us> Date: Tue, 07 May 2024 19:18:09 -0400 Message-ID: <282081.1715123889@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Wed, 8 May 2024 at 10:55, Tom Lane wrote: >> Not in a way that gives me any confidence that we found *all* the >> problems. > Here are some statements I believe to be true: > 1. If REALLOCATE_BITMAPSETS is defined then modifications to a > Bitmapset will make a copy and free the original. > 2. If a query runs successfully without REALLOCATE_BITMAPSETS and > Assert fails due to an invalid Bitmapset when REALLOCATE_BITMAPSETS is > defined, then we have > 1 pointer pointing to the same set and not all > of them are being updated when the members are added/removed. > Given the above, I can't see what Bitmapset sharing problems we won't > find with REALLOCATE_BITMAPSETS. Anything where the trouble spots are in a code path we fail to exercise with our available test suites. If you think there are no such code paths, I'm sorry to disillusion you. I spent a little bit of time wondering if we could find problems in a more static way by marking bitmapset fields as "const", but I fear that would create a huge number of false positives. regards, tom lane