bug at build_dummy_tuple

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: bug at build_dummy_tuple
Date: 2004-12-08 06:40:51
Message-ID: 20041208064050.GA16896@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


This is a weird bug. In a freshly initialized database, or just after
deleting the pg_internal.init relcache file,

SELECT 16854::regclass;

crashes the backend. (Apparently any Oid not belonging to a regclass
does the trick.) The following assertion is failed:

TRAP: FailedAssertion(«!(((ntp)->t_data)->t_infomask & 0x0010)», Archivo: «/home/alvherre/CVS/pgsql/source/00orig/src/backend/utils/cache/catcache.c», Línea: 1729)

The problem is that build_dummy_tuple() is calling HeapTupleSetOid(),
which complains apparently because it believes the pg_class relation
does not have Oids. This is wrong, but it doesn't know. In fact, next
time through, when it has the relcache built, all is well. I can attest
that the cache has wrong info, because gdb shows

(gdb) print *cache->cc_tupdesc
$15 = {natts = 25, attrs = 0x839d5d4, constr = 0x839cb3c, tdtypeid = 2249,
tdtypmod = -1, tdhasoid = 0 '\0'}
(gdb) print cache->cc_relname
$16 = 0x8266f7a "pg_class"

I don't know what the fix for this should look like ...

This doesn't seem to happen on 7.4.

Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El sabio habla porque tiene algo que decir;
el tonto, porque tiene que decir algo" (Platon).


Browse pgsql-bugs by date

  From Date Subject
Next Message yoursoft@freemail.hu 2004-12-08 10:11:20 Out of memory problem "More detailed"
Previous Message Tom Lane 2004-12-07 21:44:04 Re: Beta4 postgres.exe crash "...terminated by signal 5"