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

From Tom Lane
Subject Re: nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.
Date
Msg-id 2042498.1602039114@sss.pgh.pa.us
Whole thread Raw
In response to nbtpage.c:356 Expression 'metad->btm_root != P_NONE' is always false.  (Антон Пацев <patsev.anton@gmail.com>)
List pgsql-hackers
=?UTF-8?B?0JDQvdGC0L7QvSDQn9Cw0YbQtdCy?= <patsev.anton@gmail.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



pgsql-hackers by date:

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