Re: Using Valgrind to detect faulty buffer accesses (no pin or buffer content lock held)

From: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
To: Peter Geoghegan <pg(at)bowt(dot)ie>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Using Valgrind to detect faulty buffer accesses (no pin or buffer content lock held)
Date: 2020-07-16 17:24:51
Message-ID: 7a51c88c-0eab-8409-42db-14c070d4d9d3@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02.07.2020 20:11, Peter Geoghegan wrote:
> On Thu, Jul 2, 2020 at 7:48 AM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>> This patch fails to apply to HEAD due to conflicts in nbtpage.c, can you please
>> submit a rebased version?
> I attach the rebased patch series.
>
> Thanks

It's impressive that this check helped to find several bugs.

I only noticed small inconsistency in the new comment for
_bt_conditionallockbuf().

It says "Note: Caller is responsible for calling _bt_checkpage() on
success.", while in _bt_getbuf() the call is not followed by
_bt_checkpage().
Moreover, _bt_page_recyclable() contradicts _bt_checkpage() checks.

Other than that, patches look good to me, so move them to "Ready For
Committer".

Are you planning to add same checks for other access methods?

--
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-07-16 18:58:13 Wrong results from in_range() tests with infinite offset
Previous Message vignesh C 2020-07-16 17:13:51 Re: Parallel copy