Re: FailedAssertion

From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: FailedAssertion
Date: 2011-05-12 11:06:00
Message-ID: BANLkTimxWB-eAWQLBgyyscFOB69mz73dww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[ Forgot the list. ]

2011/5/12, Yves Weißig <weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de>:

> I'm currently debugging my developed AM and are running into this problem:
>
> TRAP: FailedAssertion("!(((bool) (((void*)(tid) != ((void *)0)) &&
> ((tid)->ip_posid != 0))))", File: "indexam.c", Line: 488)
>
> Can anybody explain what it means? I'm having difficulties to understand
> what went wrong.

Just in case you are wondering about the details of the macro-expansion:

indexam.c:484:

/* Switch to correct buffer if we don't have it already */
prev_buf = scan->xs_cbuf;
scan->xs_cbuf = ReleaseAndReadBuffer(scan->xs_cbuf,
scan->heapRelation,
ItemPointerGetBlockNumber(tid));

I.e., what you see is the expansion of ItemPointerGetBlockNumber,
which is (itemptr.h:69):

AssertMacro(ItemPointerIsValid(pointer)), \
BlockIdGetBlockNumber(&(pointer)->ip_blkid) \

ItemPointerIsValid is (itemptr.h:62):

((bool) (PointerIsValid(pointer) && ((pointer)->ip_posid != 0)))

I.e., ultimately the whole thing checks whether tid is non-null and
its ip_posid member is non-zero ("whether tid is a valid item
pointer").

I hope that helps you to figure out what happens in the context of
what you are doing.

Nicolas

--
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2011-05-12 11:09:47 Re: "stored procedures" - use cases?
Previous Message Yves Weißig 2011-05-12 09:20:43 FailedAssertion