Re: BUG #17462: Invalid memory access in heapam_tuple_lock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: anisimow(dot)d(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17462: Invalid memory access in heapam_tuple_lock
Date: 2022-04-11 17:51:38
Message-ID: 352840.1649699498@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andres Freund <andres(at)anarazel(dot)de> writes:
> One way to address it in a way not requiring an API break would be to pass
> SnapshotAny to heap_fetch and then do an explicit visibility check "ourselves"
> in heapam_lock_tuple().

I'm not really interested in fixing this without an API break (going
forward anyway), because as it stands heap_fetch is just an invitation
to make this same mistake again. It should never return a tuple pointer
if we don't keep the pin on the associated buffer.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2022-04-11 19:00:42 Re: BUG #17462: Invalid memory access in heapam_tuple_lock
Previous Message Andres Freund 2022-04-11 17:34:17 Re: BUG #17462: Invalid memory access in heapam_tuple_lock