Re: FailedAssertion - Mailing list pgsql-hackers

From Nicolas Barbier
Subject Re: FailedAssertion
Date
Msg-id BANLkTimxWB-eAWQLBgyyscFOB69mz73dww@mail.gmail.com
Whole thread Raw
In response to FailedAssertion  (Yves Weißig <weissig@rbg.informatik.tu-darmstadt.de>)
List pgsql-hackers
[ Forgot the list. ]

2011/5/12, Yves Weißig <weissig@rbg.informatik.tu-darmstadt.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?


pgsql-hackers by date:

Previous
From: Yves Weißig
Date:
Subject: FailedAssertion
Next
From: Markus Wanner
Date:
Subject: Re: "stored procedures" - use cases?