From: Justin Pryzby <pryzby@telsasoft.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-hackers@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: v16dev: invalid memory alloc request size 8488348128
Date: Fri, 14 Apr 2023 17:48:19 -0500
Message-ID: <ZDnYM8ONbQmKjxSO@telsasoft.com> (raw)
In-Reply-To: <CAApHDvoBS2VryMzJRpp9AXeOiqoMLAry+3H=1Uf6-t+uMkGbMw@mail.gmail.com>
References: <ZDm5TuKsh3tzoEjz@telsasoft.com>
<CAApHDvoBS2VryMzJRpp9AXeOiqoMLAry+3H=1Uf6-t+uMkGbMw@mail.gmail.com>
On Sat, Apr 15, 2023 at 10:04:52AM +1200, David Rowley wrote:
> On Sat, 15 Apr 2023 at 08:36, Justin Pryzby <pryzby@telsasoft.com> wrote:
> >
> > I hit this elog() while testing reports under v16 and changed to PANIC
> > to help diagnose.
> >
> > DETAILS: PANIC: invalid memory alloc request size 18446744072967930808
> > CONTEXT: PL/pgSQL function array_weight(real[],real[]) while storing call arguments into local variables
> >
> > I can't share the query, data, nor plpgsql functions themselves.
>
> Which aggregate function is being called here? Is it a custom
> aggregate written in C, by any chance?
That function is not an aggregate:
ts=# \sf array_weight
CREATE OR REPLACE FUNCTION public.array_weight(real[], real[])
RETURNS real
LANGUAGE plpgsql
IMMUTABLE PARALLEL SAFE
And we don't have any C code loaded to postgres. We do have polymorphic
aggregate functions using anycompatiblearray [*], and array_weight is
being called several times with those aggregates as its arguments.
*As in:
9e38c2bb5093ceb0c04d6315ccd8975bd17add66
97f73a978fc1aca59c6ad765548ce0096d95a923
09878cdd489ff7aca761998e7cb104f4fd98ae02
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, dgrowleyml@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: v16dev: invalid memory alloc request size 8488348128
In-Reply-To: <ZDnYM8ONbQmKjxSO@telsasoft.com>
References: <ZDm5TuKsh3tzoEjz@telsasoft.com> <CAApHDvoBS2VryMzJRpp9AXeOiqoMLAry+3H=1Uf6-t+uMkGbMw@mail.gmail.com> <ZDnYM8ONbQmKjxSO@telsasoft.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