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>, David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: 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 19:32:09
Message-ID: 8472C0A2-2656-41A0-8B75-22464408BE13@getmailspring.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom, David,

I really appreciate the time spent and the thoughtful replies on this
thread today. Honestly, I thought this would be a nice and easy single
line fix ahead of a proposal for the addition of tests for Bitmapset[1]
(which identified the issue)

I think, with v5, we're fixing this small issue in a reasonable and
understandable manner. Any chance we can agree on it and get back to
the bigger fish in the frying pan? :)

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.

best,

-greg

[1] https://github.com/gburd/postgres/pull/11/commits/0bd90e6ce7954d4324748f18717508cce64afc22
[2] https://codeberg.org/gregburd/sparsemap - a compressed bitmap index

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-08-14 19:34:24 Re: DSA overflow in hash join
Previous Message Peter Geoghegan 2025-08-14 19:30:16 Re: index prefetching