Re: `array_position...()` causes SIGSEGV

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Junseok Yang <jsyang(at)bitnine(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: `array_position...()` causes SIGSEGV
Date: 2016-12-09 12:01:20
Message-ID: 20161209120120.vsxizffxlwp62equ@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:
> On Fri, Dec 9, 2016 at 3:14 PM, Junseok Yang <jsyang(at)bitnine(dot)net> wrote:
> > I met SIGSEGV when using `array_position()` with record type
> > arguments, so I've written a patch which corrects this problem. It
> > seems that `array_position...()` sets wrong memory context for the
> > cached function (in this case `record_eq()`) which is used to find a
> > matching element.
> >
> > The problem is reproducable with the following query.
> >
> > SELECT array_position(ids, (1, 1))
> > FROM (VALUES (ARRAY[(0, 0)]), (ARRAY[(1, 1)])) AS _(ids);
>
> Good catch. That's present since 13dbc7a8 and the introduction of
> array_offset(), or array_position() on HEAD, so the patch should be
> applied down to 9.5.

Thanks for CC'ing me. Looking now.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Geoff Winkless 2016-12-09 12:10:17 Re: jsonb problematic operators
Previous Message Jordan Gigov 2016-12-09 11:50:43 jsonb problematic operators