Re: 7.3b1 panic in vacuum - Mailing list pgsql-bugs

From Tom Lane
Subject Re: 7.3b1 panic in vacuum
Date
Msg-id 7614.1036082850@sss.pgh.pa.us
Whole thread Raw
In response to 7.3b1 panic in vacuum  (Mats Lofkvist <mal@algonet.se>)
List pgsql-bugs
Mats Lofkvist <mal@algonet.se> writes:
> PANIC:  moving chain: failed to add item with len = 93 to page 9395

Thanks for the report.  I see a likely cause of this, which seems to
have been there for awhile:

                    to_vacpage->free -= MAXALIGN(tlen);
                    if (to_vacpage->offsets_used >= to_vacpage->offsets_free)
                        to_vacpage->free -= MAXALIGN(sizeof(ItemIdData));

The second MAXALIGN() shouldn't be there.  Because it is,
to_vacpage->free is decremented too much, possibly causing it to wrap
around and look large and positive, possibly allowing the code to try
to move more stuff onto the page than will fit.

> When rerunning the vacuum on the table it failed on, it seems to work:

Yeah, it would; after a system restart there'd be no tuple-chain-moving
activity because no other open transactions, so the buggy code wouldn't
get executed.

> I'm running it on a sparc/solaris box. There is no core dump.

There wouldn't be that, either; elog(PANIC) doesn't induce a core dump.
Maybe it should.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: hi-problem while installing postgressql 7.2 version
Next
From: Darcy Buskermolen
Date:
Subject: INTERVAL problems with greater than 2^32 seconds