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 1lW7vo-0005T0-Tj for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Apr 2021 01:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lW7vn-0007eN-Rk for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Apr 2021 01:33:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW7vn-0007eG-LP for pgsql-hackers@lists.postgresql.org; Tue, 13 Apr 2021 01:33:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW7vh-0006jB-73 for pgsql-hackers@lists.postgresql.org; Tue, 13 Apr 2021 01:33:31 +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 13D1XJOg3139939; Mon, 12 Apr 2021 21:33:19 -0400 From: Tom Lane To: Peter Geoghegan cc: Andres Freund , PostgreSQL Hackers Subject: Re: PANIC: wrong buffer passed to visibilitymap_clear In-reply-to: References: <2247102.1618008027@sss.pgh.pa.us> <20210409232739.sazp5p4xnnagrusa@alap3.anarazel.de> <20210409233203.3khg3s5iw34g4xrc@alap3.anarazel.de> <2644575.1618117467@sss.pgh.pa.us> <2679216.1618156670@sss.pgh.pa.us> <2689873.1618161194@sss.pgh.pa.us> <2691106.1618162892@sss.pgh.pa.us> <2691724.1618163730@sss.pgh.pa.us> <2692613.1618164979@sss.pgh.pa.us> <2902168.1618244388@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Mon, 12 Apr 2021 11:03:13 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3139937.1618277599.1@sss.pgh.pa.us> Date: Mon, 12 Apr 2021 21:33:19 -0400 Message-ID: <3139938.1618277599@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Geoghegan writes: > On Mon, Apr 12, 2021 at 9:19 AM Tom Lane wrote: >> Hence, I propose the attached. It passes check-world, but that proves >> absolutely nothing of course :-(. I wonder if there is any way to >> exercise these code paths deterministically. > This approach seems reasonable to me. At least you've managed to > structure the visibility map page pin check as concomitant with the > existing space recheck. Thanks for looking it over. Do you have an opinion on whether or not to back-patch? As far as we know, these bugs aren't exposed in the back branches for lack of code that would set the all-visible flag without superexclusive lock. But I'd still say that heap_update is failing to honor its API contract in these edge cases, and that seems like something that could bite us after future back-patches. Or there might be third-party code that can set all-visible flags. So I'm kind of tempted to back-patch, but it's a judgment call. regards, tom lane