Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function
Date
Msg-id CAB7nPqTAtzikH1MaQy2kbN7PS69Du+O5mFwkC6x_xNwo_KdCvw@mail.gmail.com
Whole thread Raw
In response to BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function  (b.yordanov2@gmail.com)
Responses Re: BUG #13680: PostgreSQL backend process crashes on jsonb_object_agg() in plpgsql recursive function  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Thu, Oct 15, 2015 at 1:08 AM,  <b.yordanov2@gmail.com> wrote:
> Calling the function like this causes the crash:
> sravni_hstore=> select * from
> recursive_stats_daily('{}'::jsonb,'1h'::interval);
> server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.

Indeed. Reusing your example with the script attached I can reproduce
the crash easily:
* thread #1: tid = 0x0000, 0x0000000106674720
postgres`JsonbValueToJsonb(val=0x0000000000000000) + 16 at
jsonb_util.c:82, stop reason = signal SIGSTOP
  * frame #0: 0x0000000106674720
postgres`JsonbValueToJsonb(val=0x0000000000000000) + 16 at
jsonb_util.c:82
    frame #1: 0x0000000106670a05
postgres`jsonb_object_agg_transfn(fcinfo=0x00007f9fc8958710) + 1061 at
jsonb.c:1824
    frame #2: 0x0000000106401bb2
postgres`advance_transition_function(aggstate=0x00007f9fc8950788,
pertrans=0x00007f9fc8958638, pergroupstate=0x00007f9fc89637b0) + 386
at nodeAgg.c:7

I am looking into it in more details, for now I have added an open item for 9.5.
Regards,
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: odo@odoo.com
Date:
Subject: BUG #13681: Serialization failures caused by new multixact code of 9.3 (back-patch request)
Next
From: doppalapudisaikumar@gmail.com
Date:
Subject: BUG #13682: error while connecting to database