pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485)
Date: Tue, 31 May 2022 17:52:09 -0400
Message-ID: <347628.1654033929@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGKWXaUHS7MZxxTYXGZ-04QeftwK+eeaycoQ3q7=+t9PTQ@mail.gmail.com>
References: <20220519193839.GT19626@telsasoft.com>
	<208993.1652994963@sss.pgh.pa.us>
	<20220520.120014.1649415417205853644.horikyota.ntt@gmail.com>
	<CA+Tgmob26sUtT8h2tnqttx1WRfi56FrRELs77ANCXvmVMv3w3g@mail.gmail.com>
	<321315.1654027805@sss.pgh.pa.us>
	<CA+hUKG+zSZ8ZkrS0GRhvaRQBMbfKcBJi_XdtA9nDKt4ODXxR1w@mail.gmail.com>
	<CA+TgmoaWZ-hs1vQ8C88ZE57oXpsWj5oxYZYR9y7c2H+uoikz_A@mail.gmail.com>
	<331489.1654031367@sss.pgh.pa.us>
	<CA+hUKGKWXaUHS7MZxxTYXGZ-04QeftwK+eeaycoQ3q7=+t9PTQ@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> 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





view thread (25+ messages)  latest in thread

Message-ID: <347628.1654033929@sss.pgh.pa.us>
Permalink:  ../347628.1654033929@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/347628.1654033929@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, robertmhaas@gmail.com, horikyota.ntt@gmail.com, pryzby@telsasoft.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: pg15b1: FailedAssertion("val > base", File: "...src/include/utils/relptr.h", Line: 67, PID: 30485)
  In-Reply-To: <347628.1654033929@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox