Re: Assert in pageinspect with NULL pages

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Alexander Lakhin <exclusion@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, Daria Lepikhova <d.lepikhova@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-03-25T04:57:06Z
Lists: pgsql-hackers
On Thu, Mar 24, 2022 at 08:54:14PM -0700, Peter Geoghegan wrote:
> amcheck's palloc_btree_page() function validates that an 8KiB page is
> in fact an nbtree page, in a maximally paranoid way. Might be an
> example worth following here.

Sure, we could do that.  However, I don't think that going down to
that is something we have any need for in pageinspect, as the module
is also useful to look at the contents of the full page, even if
slightly corrupted, and too many checks would prevent a lookup at the
internal contents of a page.
--
Michael

Commits

  1. pageinspect: Fix handling of all-zero pages

  2. pageinspect: Add more sanity checks to prevent out-of-bound reads

  3. pageinspect: Fix handling of page sizes and AM types

  4. Teach pageinspect about nbtree deduplication.