Possibly too stringent Assert() in b-tree code - Mailing list pgsql-hackers

From Antonin Houska
Subject Possibly too stringent Assert() in b-tree code
Date
Msg-id 2628.1474272158@localhost
Whole thread Raw
Responses Re: Possibly too stringent Assert() in b-tree code  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
I've recently seen this when using 9.6:

#0  0x00007f147892f0c7 in raise () from /lib64/libc.so.6
#1  0x00007f1478930478 in abort () from /lib64/libc.so.6
#2  0x00000000009683a1 in ExceptionalCondition (conditionName=0x9f2ef8 "!(((PageHeader) (page))->pd_special >=
(__builtin_offsetof(PageHeaderData, pd_linp)))", errorType=0x9f2e8a "FailedAssertion",   fileName=0x9f2e60
"../../../../src/include/storage/bufpage.h",lineNumber=314) at assert.c:54 
#3  0x00000000004ee3d2 in PageValidateSpecialPointer (page=0x7f14700f3480 "") at
../../../../src/include/storage/bufpage.h:314
#4  0x00000000004ef913 in _bt_getbuf (rel=0x7f14795a1a50, blkno=11, access=2) at nbtpage.c:629
#5  0x00000000004eae8c in _bt_split (rel=0x7f14795a1a50, buf=136, cbuf=0, firstright=367, newitemoff=408, newitemsz=16,
newitem=0x2608330,newitemonleft=0 '\000') at nbtinsert.c:986 
#6  0x00000000004ea563 in _bt_insertonpg (rel=0x7f14795a1a50, buf=136, cbuf=0, stack=0x26090c8, itup=0x2608330,
newitemoff=408,split_only_page=0 '\000') at nbtinsert.c:781 
#7  0x00000000004e954c in _bt_doinsert (rel=0x7f14795a1a50, itup=0x2608330, checkUnique=UNIQUE_CHECK_YES,
heapRel=0x25aa0a0)at nbtinsert.c:204 
#8  0x00000000004f3b73 in btinsert (rel=0x7f14795a1a50, values=0x7ffe46c6f7f0, isnull=0x7ffe46c6f7d0 "",
ht_ctid=0x260927c,heapRel=0x25aa0a0, checkUnique=UNIQUE_CHECK_YES) at nbtree.c:279 
#9  0x00000000004e7964 in index_insert (indexRelation=0x7f14795a1a50, values=0x7ffe46c6f7f0, isnull=0x7ffe46c6f7d0 "",
heap_t_ctid=0x260927c,heapRelation=0x25aa0a0, checkUnique=UNIQUE_CHECK_YES)   at indexam.c:204 

Of course, the database could have been corrupted after having encountered
many crashes during my experiments. Neverthelesss, even without in-depth
knowledge of the b-tree code I suspect that this stack trace might reflect a
legal situation. In partcular, if _bt_page_recyclable() returned on this
condition:
if (PageIsNew(page))    return true;


Unfortunately I no longer have the cluster nor the core dump, but I remember
all the fields of PageHeader were indeed zeroed.

--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at



pgsql-hackers by date:

Previous
From: Rahila Syed
Date:
Subject: Re: Improvements in psql hooks for variables
Next
From: Pavel Stehule
Date:
Subject: Re: IF (NOT) EXISTS in psql-completion