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 1oSf7G-0006vG-UI for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Aug 2022 13:47:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSf7F-0007sj-Mm for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Aug 2022 13:47:49 +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 1oSf7F-0007sZ-Do for pgsql-hackers@lists.postgresql.org; Mon, 29 Aug 2022 13:47:49 +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 1oSf7D-0007NU-8c for pgsql-hackers@lists.postgresql.org; Mon, 29 Aug 2022 13:47: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 27TDlhs13137573; Mon, 29 Aug 2022 09:47:43 -0400 From: Tom Lane To: David Rowley cc: 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: References: <9dec1bd42fed3e263de294116380e5b51c427267.camel@postgrespro.ru> <20220712174404.polbc5it7j6mzmql@awork3.anarazel.de> <20220809184410.g6yzu6pvttuphag5@awork3.anarazel.de> Comments: In-reply-to David Rowley message dated "Mon, 29 Aug 2022 23:10:53 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3137571.1661780863.1@sss.pgh.pa.us> Date: Mon, 29 Aug 2022 09:47:43 -0400 Message-ID: <3137572.1661780863@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I suspect, going by all 3 failing animals being 32-bit which have a > MAXIMUM_ALIGNOF 8 and SIZEOF_SIZE_T of 4 that this is due to the lack > of padding in the MemoryChunk struct. > AllocChunkData and GenerationChunk had padding to account for > sizeof(Size) being 4 and sizeof(void *) being 8, I didn't add that to > MemoryChunk, so I'll do that now. Doesn't seem to have fixed it. IMO, the fact that we can get through core regression tests and pg_upgrade is a strong indicator that there's not anything fundamentally wrong with memory context management. I'm inclined to think the problem is in d2169c9985, instead ... though I can't see anything wrong with it. Another possibility is that there's a pre-existing bug in the logical decoding stuff that your changes accidentally exposed. I wonder if valgrind would show anything interesting. regards, tom lane