Hi Shihao,

On Sat, Nov 14, 2026 at 9:39 PM shihao zhong <[email protected]> wrote:

> If v4 still looks good to you, would you mind marking the CF entry
> Ready for Committer?
>

Thanks for working on this. I ran into this while looking at a
corrupted btree index: bt_page_stats() didn't report the bad page, it
just returned stats computed from it (and fails an assertion on an
assert-enabled build).

I tested v4 and it fixes the crashes for me, but bt_page_stats() and
bt_multi_page_stats() are not covered. They go through
GetBTPageStatistics(), which adds up the tuple sizes of every line
pointer without checking them. With a zeroed line pointer on a btree
leaf, bt_page_items() now gives an error, but bt_page_stats() on the
same page still fails Assert("ItemIdHasStorage(itemId)").

The attached 0003 adds the same check you use in bt_page_print_tuples()
to GetBTPageStatistics(). It applies on top of v4. I named it .nocfbot
so cfbot keeps testing your series; feel free to fold it into v5.

A few smaller things:

- 0002 needs a rebase.
- The new line pointer checks and verify_page_header() use
  ERRCODE_INVALID_PARAMETER_VALUE, but the posting list and pivot tuple
  checks use ERRCODE_DATA_CORRUPTED, which heapfuncs.c also uses for
  this. I think they should all be DATA_CORRUPTED. (I kept
  INVALID_PARAMETER_VALUE in 0003 to match the rest of v4.)

Thanks,
Baji Shaik

Attachment: v4-0003-pageinspect-check-line-pointers-in-bt_page_stats-and.patch.nocfbot
Description: Binary data

Reply via email to