From: Michael Paquier <michael@paquier.xyz>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Date: Mon, 4 Sep 2023 15:35:41 +0900
Message-ID: <ZPV6vblm1jmgs1VW@paquier.xyz> (raw)
In-Reply-To: <09fec706-0691-a131-5c6c-3e64ecc134fc@gmail.com>
References: <17950-6c80a8d2b94ec695@postgresql.org>
<da453149-fa9e-67fc-fbce-80cca399bce5@gmail.com>
<e2f36991-0519-bfcf-1da9-c31ca645b4ec@gmail.com>
<665394.1691937343@sss.pgh.pa.us>
<09fec706-0691-a131-5c6c-3e64ecc134fc@gmail.com>
On Sun, Aug 13, 2023 at 09:00:01PM +0300, Alexander Lakhin wrote:
> I've tried to make that addition as valuable as possible in the context of
> this issue, but as it is too expensive (to be honest, I was bolstered by
> the gin test duration (~10 secs too)), then let's leave it aside.
I have applied 0001 down to 11 to get the basic fix in place, but the
regression tests are really too expensive compared to the value they
bring.
Regarding the changes in gtsvectorout(), the output produced is indeed
confusing when ISALLTRUE is set.
- int siglen = GETSIGLEN(key);
- int cnttrue = (ISALLTRUE(key)) ? SIGLENBIT(siglen) : sizebitvec(GETSIGN(key), siglen);
+ if (ISALLTRUE(key))
+ sprintf(outbuf, "all true bits");
+ else
+ {
+ int siglen = GETSIGLEN(key);
+ int cnttrue = (ISALLTRUE(key)) ? SIGLENBIT(siglen) : sizebitvec(GETSIGN(key), siglen);
- sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
+ sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
+ }
In the false branch of ISALLTRUE(key), why isn't cnttrue always
calculated with sizebitvec()? It's also not something I would
backpatch. That's confusing, for sure, but there is also the argument
of keeping a consistent output in the stable branches.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../ZPV6vblm1jmgs1VW@paquier.xyz/2-signature.asc)
download
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-bugs@postgresql.org
Cc: michael@paquier.xyz, exclusion@gmail.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
In-Reply-To: <ZPV6vblm1jmgs1VW@paquier.xyz>
* 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