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 1oTYez-0006HH-DD for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 01:06:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oTYey-0008VN-0R for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Sep 2022 01:06:20 +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 1oTYex-0008VE-NY for pgsql-hackers@lists.postgresql.org; Thu, 01 Sep 2022 01:06:19 +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 1oTYer-0002Yw-2w for pgsql-hackers@lists.postgresql.org; Thu, 01 Sep 2022 01:06:18 +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 281169m5225786; Wed, 31 Aug 2022 21:06:09 -0400 From: Tom Lane To: Tomas Vondra cc: David Rowley , 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: <3137572.1661780863@sss.pgh.pa.us> <3205803.1661786437@sss.pgh.pa.us> <3478405.1661824539@sss.pgh.pa.us> <3605020.1661865981@sss.pgh.pa.us> <3613565.1661869054@sss.pgh.pa.us> <60560f75-8b15-a7cc-67bc-a7bf3e8472ee@enterprisedb.com> <209211.1661991821@sss.pgh.pa.us> Comments: In-reply-to Tomas Vondra message dated "Thu, 01 Sep 2022 02:49:36 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <225784.1661994369.1@sss.pgh.pa.us> Date: Wed, 31 Aug 2022 21:06:09 -0400 Message-ID: <225785.1661994369@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > You're probably right we'll notice the clobber cases due to corruption > of the next chunk header. The annoying thing is having a corrupted > header only tells you there's a corruption somewhere, but it may be hard > to know which part of the code caused it. Same's true of a sentinel, though. > OTOH we have platforms where valgrind is either not supported or no one > runs tests with (e.g. on rpi4 it'd take insane amounts of code). According to https://valgrind.org/info/platforms.html valgrind supports a pretty respectable set of platforms. It might be too slow to be useful on ancient hardware, of course. I've had some success in identifying clobber perpetrators by putting a hardware watchpoint on the clobbered word, which IIRC does work on recent ARM hardware. It's tedious and far more manual than valgrind, but it's possible. regards, tom lane