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 1oSgeL-0004SO-Ab for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Aug 2022 15:26:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSgeJ-0008CL-Gw for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Aug 2022 15:26:03 +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 1oSgeJ-0008CC-75 for pgsql-hackers@lists.postgresql.org; Mon, 29 Aug 2022 15:26:03 +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 1oSgeH-0008Mj-3b for pgsql-hackers@lists.postgresql.org; Mon, 29 Aug 2022 15:26:02 +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 27TFPvpj3207034; Mon, 29 Aug 2022 11:25:57 -0400 From: Tom Lane To: David Rowley cc: Tomas Vondra , Amit Kapila , Andres Freund , Robert Haas , Yura Sokolov , PostgreSQL Developers Subject: Re: Reducing the chunk header sizes on all memory context types In-reply-to: <3205803.1661786437@sss.pgh.pa.us> References: <20220809184410.g6yzu6pvttuphag5@awork3.anarazel.de> <3137572.1661780863@sss.pgh.pa.us> <3205803.1661786437@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 29 Aug 2022 11:20:37 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3207032.1661786757.1@sss.pgh.pa.us> Date: Mon, 29 Aug 2022 11:25:57 -0400 Message-ID: <3207033.1661786757@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > So the bug is in fact in David's changes, and it consists in palloc > sometimes handing back non-maxaligned pointers. I find it mildly > astonishing that we managed to get through core regression tests > without such a fault surfacing, but there you have it. Oh! I just noticed that the troublesome context (rb->change_context) is a SlabContext, so it may be that this only happens in non-aset contexts. It's a lot easier to believe that the core tests never exercise the case of pfree'ing a slab chunk. regards, tom lane