Re: nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Антон Пацев <patsev(dot)anton(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.
Date: 2020-10-07 02:51:54
Message-ID: 2042498.1602039114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?0JDQvdGC0L7QvSDQn9Cw0YbQtdCy?= <patsev(dot)anton(at)gmail(dot)com> writes:
> I am trying to help for Project PostgreSQL. Check source code PostgreSQL by
> PVS-Studio.
> PVS-Studio have many issue, but some issue is interesting.
> nbtpage.c:356 <http://localhost/sources/nbtpage.c_24.html#ln356> *High* V547
> <https://www.viva64.com/en/w/v547/> Expression 'metad->btm_root != 0' is
> always false.

This is incorrect. The tool apparently doesn't understand that the
storage pointed to by metad can be changed by other processes in the
interval where we don't hold a lock on the buffer.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-10-07 04:56:36 Re: [HACKERS] Custom compression methods
Previous Message Антон Пацев 2020-10-07 02:31:15 nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.