Re: [HACKERS] Fix freeing of dangling IndexScanDesc.xs_hitup in GiST - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Fix freeing of dangling IndexScanDesc.xs_hitup in GiST
Date
Msg-id 25148.1493925400@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Fix freeing of dangling IndexScanDesc.xs_hitup in GiST  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Responses Re: [HACKERS] Fix freeing of dangling IndexScanDesc.xs_hitup in GiST  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] json_agg produces nonstandard json
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Potential issue with alter system