Re: BUG #14134: segmentation fault with large table with gist index

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Euler Taveira <euler(at)timbira(dot)com(dot)br>
Cc: yjh0502(at)gmail(dot)com, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14134: segmentation fault with large table with gist index
Date: 2016-05-11 20:13:53
Message-ID: CAM3SWZQ3a_U38mN6O7UrUcGGATVw_56O_5wqrbopZ3LnpbmU1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, May 11, 2016 at 12:56 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Consider that most types have SortSupport, and so will use their own
> memory context if memory allocation is needed for nodeIndexScan.c's
> new-to-9.5 sort-like merging involving SortSupport. The field
> ssup_collation was also not correctly initialized, for example, but
> the SortSupport was allocated with palloc0(), so any problems that
> that causes for collatable types will be relatively subtle. According
> to convention, we won't attempt allocation with the ssup_ctx "parent"
> memory context (which is NULL here), or we won't allocate any memory
> at all in the case of simple pass-by-value types like int4.

On second thought, any memory allocation would almost certainly lead
to a segfault in practice. That just leaves pass-by-value types as
space for the bug to hide.

--
Peter Geoghegan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2016-05-11 20:36:16 Re: BUG #14132: ON CONFLICT not inferring unique index with bigints
Previous Message Peter Geoghegan 2016-05-11 19:56:38 Re: BUG #14134: segmentation fault with large table with gist index