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 1nw9mi-00032M-Kz for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 21:52:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nw9mh-0007Ga-Da for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 21:52:15 +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 1nw9mh-0007GA-40 for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 21:52:15 +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 1nw9me-0003Dn-Tg for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 21:52: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 24VLq9a3347629; Tue, 31 May 2022 17:52:09 -0400 From: Tom Lane To: Thomas Munro cc: Robert Haas , Kyotaro Horiguchi , Justin Pryzby , PostgreSQL Hackers Subject: Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485) In-reply-to: References: <20220519193839.GT19626@telsasoft.com> <208993.1652994963@sss.pgh.pa.us> <20220520.120014.1649415417205853644.horikyota.ntt@gmail.com> <321315.1654027805@sss.pgh.pa.us> <331489.1654031367@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Wed, 01 Jun 2022 09:26:30 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <347627.1654033929.1@sss.pgh.pa.us> Date: Tue, 31 May 2022 17:52:09 -0400 Message-ID: <347628.1654033929@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > Count we make the relptrs 1-based, so that 0 is reserved as a sentinel > that has the nice memset(0) property? Hm ... almost. A +1 offset would mean that zero is ambiguous with a pointer to the byte just before the relptr. Maybe that case never arises in practice, but now that we've seen this problem I'm not real comfortable with such an assumption. But how about a -1 offset? Then zero would be ambiguous with a pointer to the second byte of the relptr, and I think I *am* prepared to assume that that has no use-cases. The other advantage of such a definition is that it'd help flush out anybody breaking the relptr abstraction ;-) regards, tom lane