pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: gregk@stoddarts.com.au
Subject: BUG #15578: Executing json_populate_recordset with an empty array causes a segmentation fault
Date: Mon, 07 Jan 2019 03:52:26 +0000
Message-ID: <15578-832c854e58dde50c@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15578
Logged by:          Greg Keegan
Email address:      gregk@stoddarts.com.au
PostgreSQL version: 11.1
Operating system:   CentOS Linux release 7.1.1503 (Core)
Description:        

When executing json_populate_recordset/jsonb_populate_recordset with an
empty array, a segmentation fault occurs and the server process is
terminated. The issue occurs regardless of the type used. In previous
versions this would return null.

Example:
CREATE TYPE test_type AS (amount numeric, description text);
SELECT * FROM json_populate_recordset(null::test_type,'[]');

Log:
2019-01-07 13:46:58.196 AEST [1847] LOG:  server process (PID 4341) was
terminated by signal 11: Segmentation fault
2019-01-07 13:46:58.196 AEST [1847] DETAIL:  Failed process was running:
SELECT * FROM json_populate_recordset(null::test_type,'[]');
2019-01-07 13:46:58.196 AEST [1847] LOG:  terminating any other active
server processes
2019-01-07 13:46:58.202 AEST [4213] WARNING:  terminating connection because
of crash of another server process
2019-01-07 13:46:58.202 AEST [4213] DETAIL:  The postmaster has commanded
this server process to roll back the current transaction and exit, because
another server process exited abnormally and possibly corrupted shared
memory.
2019-01-07 13:46:58.202 AEST [4213] HINT:  In a moment you should be able to
reconnect to the database and repeat your command.
2019-01-07 13:46:58.210 AEST [1847] LOG:  all server processes terminated;
reinitializing
2019-01-07 13:46:58.884 AEST [4374] LOG:  database system was interrupted;
last known up at 2019-01-07 13:42:07 AEST
2019-01-07 13:46:59.565 AEST [4374] LOG:  database system was not properly
shut down; automatic recovery in progress
2019-01-07 13:46:59.592 AEST [4374] LOG:  redo starts at 29/CD051528
2019-01-07 13:46:59.593 AEST [4374] LOG:  invalid record length at
29/CD069AD0: wanted 24, got 0
2019-01-07 13:46:59.593 AEST [4374] LOG:  redo done at 29/CD069A98
2019-01-07 13:46:59.593 AEST [4374] LOG:  last completed transaction was at
log time 2019-01-07 13:46:44.868687+10
2019-01-07 13:46:59.708 AEST [1847] LOG:  database system is ready to accept
connections



view thread (3+ messages)  latest in thread

Message-ID: <15578-832c854e58dde50c@postgresql.org>
Permalink:  ../15578-832c854e58dde50c@postgresql.org/
Also on:    postgresql.org/message-id/15578-832c854e58dde50c@postgresql.org

 · 

reply

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-bugs@postgresql.org
  Cc: noreply@postgresql.org, gregk@stoddarts.com.au
  Subject: Re: BUG #15578: Executing json_populate_recordset with an empty array causes a segmentation fault
  In-Reply-To: <15578-832c854e58dde50c@postgresql.org>
  References: <15578-832c854e58dde50c@postgresql.org>

* 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