From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: array_agg(DISTINCT) caused a segmentation fault
Date: Mon, 13 Feb 2023 18:03:58 +0900
Message-ID: <43ad904c-8e62-a96f-91d7-b4894a433e20@oss.nttdata.com> (raw)
In-Reply-To: <CAApHDvrWu0G1caebi21=pELRtpcyu+1sDvo_c-vkogYJ=tQrvA@mail.gmail.com>
References: <860c6d6f-a3c5-3ae9-9da2-827177bede06@oss.nttdata.com>
<CAApHDvrWu0G1caebi21=pELRtpcyu+1sDvo_c-vkogYJ=tQrvA@mail.gmail.com>
On 2023/02/13 16:44, David Rowley wrote:
> On Mon, 13 Feb 2023 at 18:29, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>> =# SELECT array_agg(distinct val) FROM (SELECT NULL AS val FROM generate_series(1, 2)) hoge;
>> LOG: server process (PID 76507) was terminated by signal 11: Segmentation fault: 11
>> DETAIL: Failed process was running: SELECT array_agg(distinct val) FROM (SELECT NULL AS val FROM generate_series(1, 2)) hoge;
>
> This was a fairly trivial logic bug in
> ExecEvalPreOrderedDistinctSingle(). The JIT code calls that same
> function and ExecEvalPreOrderedDistinctMulti() uses the standard
> expression evaluation logic. So looks like the problem is just
> isolated to ExecEvalPreOrderedDistinctSingle().
>
> I've now pushed a fix for it and included your test. To get it to
> crash it needed to be a byref aggregate without a strict transition
> function. There are not too many of those, which is probably why
> nobody noticed this before.
Thanks for the fix!
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: masao.fujii@oss.nttdata.com, dgrowleyml@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: array_agg(DISTINCT) caused a segmentation fault
In-Reply-To: <43ad904c-8e62-a96f-91d7-b4894a433e20@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox