Re: BUG #17462: Invalid memory access in heapam_tuple_lock

Поиск
Список
Период
Сортировка
Искать
От
Peter Geoghegan
Тема
Re: BUG #17462: Invalid memory access in heapam_tuple_lock
Дата
Msg-id
CAH2-Wzmxcidt0u4_7pfXZ_ExEOKa_Epb-b3vAcM_D899WAO2rA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
BUG #17462: Invalid memory access in heapam_tuple_lock PG Bug reporting form <noreply@postgresql.org>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Andres Freund <andres@anarazel.de>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Andres Freund <andres@anarazel.de>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Andres Freund <andres@anarazel.de>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Andres Freund <andres@anarazel.de>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Peter Geoghegan <pg@bowt.ie>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #17462: Invalid memory access in heapam_tuple_lock Peter Geoghegan <pg@bowt.ie>
On Mon, Apr 11, 2022 at 9:35 AM Tom Lane  wrote:
> > The other backend's page defragmentation step (from pruning)
> > would render our backend's HeapTuple pointer invalid. Presumably it
> > would just look like an invalid/non-matching xmin in our backend, at
> > the point of control flow that Valgrind complains about
> > (heapam_handler.c:509).
>
> Right, but there are other accesses below, and in any case match
> failure isn't necessarily the right thing.

That's what I meant -- it very likely would have been a match if the
same scenario played out, but without any concurrent pruning. With a
concurrent prune, xmin won't ever be a match (barring a
near-miraculous coincidence). That behavior is definitely wrong, but
also quite subtle (compared to what might happen if we got past the
xmin/xmax check). I think that that explains why it took this long to
notice the bug.

-- 
Peter Geoghegan


В списке pgsql-bugs по дате отправления
От: Tom Lane
Дата:
От: Andres Freund
Дата:
FAQ