Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'
Date: 2023-11-15 15:06:32
Message-ID: CAPpHfdtSQr-G7Lct_VLy7uAEH9tR5V4LghxtNZQ9pQBmJbZu0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 15, 2023 at 8:04 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2023-11-14 14:42:13 +0200, Alexander Korotkov wrote:
> > It's possibly dumb option, but what about just removing the assert?
>
> That's not at all an option - the in-place bms_* functions can free their
> input. So a dangling pointer to the "old" version is a use-after-free waiting
> to happen - you just need a query that actually gets to bitmapsets that are a
> bit larger.

Yeah, now I got it, thank you. I was under the wrong impression that
bitmapset has the level of indirection, so the pointer remains valid.
Now, I see that bitmapset manipulation functions can do free/repalloc
making the previous bitmapset pointer invalid.

------
Regards,
Alexander Korotkov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2023-11-15 15:07:15 Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'
Previous Message Julien Rouhaud 2023-11-15 15:03:23 Re: Fix documentation for pg_stat_statements JIT deform_counter