Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words

From: Greg Burd <greg(at)burd(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] bms_prev_member() can read beyond the end of the array of allocated words
Date: 2025-08-14 22:12:08
Message-ID: A985FAC6-3B19-41D3-BC5C-76CDB294BDDD@burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Aug 14, 2025, at 3:45 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Greg Burd <greg(at)burd(dot)me> writes:
>> Spoiler alert, I have larger plans[2] for Bitmapset which is why I
>> started down this road to begin with as I wanted to capture the existing
>> API/contract for it before I proposed changes to it.
>
> FWIW, I'd be seriously resistant to simply replacing Bitmapset with
> something like that, as I think the present implementation is about
> right for the planner's uses and complicating it would just slow
> things down. There may be specific places where a compressed
> implementation could win, though.

Well, I get that and I know I’m battling uphill. :) Can’t hurt to
measure and see if there is a benefit or not. If not, I’ll just propose
a different Sparsemapset (or other reasonable name) in addition to the
existing Bitmapset for the use case that pushed me in this direction.
No reason not to explore options, right?

> Anyway, that's off-topic for the present thread. I believe it's
> middle-of-the-night in Rowley's time zone, so I was waiting for
> further comment from him before taking any action.

Makes perfect sense, sorry to rush the process.

> regards, tom lane

best,

-greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-08-14 22:16:14 Re: Support getrandom() for pg_strong_random() source
Previous Message Masahiko Sawada 2025-08-14 22:11:28 Re: Support getrandom() for pg_strong_random() source