Re: crash on 8.2 and cvshead - failed to add item to the

From: Joe Conway <mail(at)joeconway(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: crash on 8.2 and cvshead - failed to add item to the
Date: 2007-01-25 16:10:53
Message-ID: 45B8D68D.9080207@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas wrote:
> Heikki Linnakangas wrote:
>> Joe Conway wrote:
>>> We just came upon a crash bug in Postgres >= 8.2. The attached
>>> standalone script (just needs a database with plpgsql installed)
>>> reproduces the crash for me on 32-bit machines (i686) but NOT on 64 bit
>>> machines (x86_64), for Postgres 8.2 and cvs-head, but not on 8.1. We've
>>> verified this on about four 32 bit machines, and four 64 bit machines
>>> (including one each under vmware on the same host). All machines were
>>> some flavor of Red Hat, Fedora, or Gentoo.
>> Hmm. There seems to be something wrong in the free space calculation in
>> the algorithm for choosing the right split location. I'll dig deeper,
>> unless someone beats me to it..
>
> I think I found it. The page splitting code didn't take into account
> that when the new item is the first one on the right page, it also
> becomes the high key of the left page. The fact that this test case
> triggered it in 32 bit machines and not on 64 bit machines was a
> coincidence.
>
> Patch attached.

Thanks! That seems to have fixed it. Both the original test case and a
somewhat simplified one that we created a few minutes ago work fine now,
on 8.2 and cvs-head. The simplified case is still about 22K gzipped --
let me know if you want a copy and I'll send it off list.

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-01-25 16:11:58 Re: crash on 8.2 and cvshead - failed to add item to the
Previous Message Teodor Sigaev 2007-01-25 16:06:16 Re: tsearch in core patch, for inclusion