pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@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 18:14:13 -0400
Message-ID: <351605.1654035253@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoY7yhdRDibcuuF7Kn2hr7pfS031zuRa1TF8CXvmLq8pdA@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>
	<347628.1654033929@sss.pgh.pa.us>
	<CA+TgmoY7yhdRDibcuuF7Kn2hr7pfS031zuRa1TF8CXvmLq8pdA@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> Seems backwards to me. A relative pointer is supposed to point to
> something inside some range of memory, like a DSM gment -- it can
> never be legally used to point to anything outside that segment. So it
> seems to me that you could perfectly legally point to the second byte
> of the segment, but never to the -1'th byte.

Okay, I was thinking about it slightly wrong: relptr is defined as an
offset relative to some base address, not to its own address.  As long
as you're prepared to assume that the base address really is the start
of the addressable area, then yeah the above argument works.

However, now that I've corrected that mistaken image ... I wonder if
it could make sense to redefine relptr as self-relative?  That ought
to provide some notational savings since you'd only need to carry
around the relptr's own address not that plus a base address.
Probably not something to consider for v15 though.

			regards, tom lane





view thread (25+ messages)  latest in thread

Message-ID: <351605.1654035253@sss.pgh.pa.us>
Permalink:  ../351605.1654035253@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/351605.1654035253@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, robertmhaas@gmail.com, thomas.munro@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: <351605.1654035253@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