Nikita Glukhov <n.gluhov@postgrespro.ru> writes:
> In gistrescan() IndexScanDesc.xs_hitup is not reset after MemoryContextReset() of
> so->queueCxt in which xs_hitup was allocated, then getNextNearest() tries to pfree()
> dangling xs_hitup, which results in the reuse of this pointer and the subsequent crash.
Right. I already did something about this, about an hour ago --- a
bit differently from your patch, but same idea.
regards, tom lane