Re: corrupted item pointer:???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "hubert depesz lubaczewski" <depesz(at)gmail(dot)com>
Cc: "Richard Huxton" <dev(at)archonet(dot)com>, "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: corrupted item pointer:???
Date: 2006-04-14 15:40:29
Message-ID: 9618.1145029229@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"hubert depesz lubaczewski" <depesz(at)gmail(dot)com> writes:
> i made pg_filedump _FILE_ > ~/_FILE_.dump
> it went fine
> grep -i error ~/*.dump also didn't show anything.

Oh, that's interesting. Looking more closely, the test in
PageRepairFragmentation()

if (itemidptr->itemoff < (int) pd_upper ||
itemidptr->itemoff >= (int) pd_special)
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg("corrupted item pointer: %u",
itemidptr->itemoff)));

is slightly tighter than what pg_filedump does:

// Make sure the item can physically fit on this block before
// formatting
if ((itemOffset + itemSize > blockSize) ||
(itemOffset + itemSize > bytesToFormat))
printf (" Error: Item contents extend beyond block.\n"
" BlockSize<%d> Bytes Read<%d> Item Start<%d>.\n",
blockSize, bytesToFormat, itemOffset + itemSize);

I'm guessing that the lack of a check for itemOffset < pd_upper is why
pg_filedump is failing to notice anything wrong. Do you want to add one
and try again?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-14 15:48:22 Re: what the problem with this query
Previous Message Tomi NA 2006-04-14 15:33:23 Re: ilike and utf-8