From: Michael Paquier <michael@paquier.xyz>
To: shihao zhong <zhong950419@gmail.com>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19780: gtsvector_picksplit() reads uninitialized data when called with three entries
Date: Fri, 6 Nov 2026 17:16:37 +0900
Message-ID: <au2M5c6TISykG8QR@paquier.xyz> (raw)
In-Reply-To: <au2HNfBBz9haENO4@paquier.xyz>
References: <19780-93fb5c0e4ec2af18@postgresql.org>
<CAGRkXqTnM1a9o9raz-3qZfHagf_An5fyyNdb7=uTAREpQ9Md4w@mail.gmail.com>
<au2HNfBBz9haENO4@paquier.xyz>
On Fri, Nov 06, 2026 at 04:52:21PM +0900, Michael Paquier wrote:
> So the problem is this one, where we could try to read the cached data
> for seed_2 but it's just not initialized yet:
> datum_r = gtsvector_alloc(SIGNKEY | (cache[seed_2].allistrue ?
> ALLISTRUE : 0), siglen, cache[seed_2].sign);
>
> Calling fillcache() earlier so as datum_r and datum_l are built from
> correct values is enough. Your change makes sense.
+INSERT INTO test_tsvector_wide
+ SELECT 'foo', decode(string_agg(md5(g::text), ''), 'hex')
+ FROM generate_series(1, 300) g;
By the way, this test is going to piss buildfarm members that have
FIPS enabled, where md5() calls fail. Could it be possible to write a
test that's more portable across the board? There is a v19 RC2 in
sight, and it's already late in the week here so this will have to
wait until the tag of the next version is pushed around next
Wednesday. It's an old issue, so a few more days will not matter.
There is a fipshash() in test_setup.sql, written for portability, but
perhaps we can make the test much faster by using the same tricks as
test_decoding's toast.sql in terms of generation of long values?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) 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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, zhong950419@gmail.com, exclusion@gmail.com
Subject: Re: BUG #19780: gtsvector_picksplit() reads uninitialized data when called with three entries
In-Reply-To: <au2M5c6TISykG8QR@paquier.xyz>
References: <19780-93fb5c0e4ec2af18@postgresql.org> <CAGRkXqTnM1a9o9raz-3qZfHagf_An5fyyNdb7=uTAREpQ9Md4w@mail.gmail.com> <au2HNfBBz9haENO4@paquier.xyz> <au2M5c6TISykG8QR@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