Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggNDJ-0001kf-3N for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 05:12:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggNDH-0006Qn-NS for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 05:12:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggNDH-0006Oh-Ds for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 05:12:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggNDE-0000rl-Iz for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 05:12:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x075CS0t013028; Mon, 7 Jan 2019 00:12:29 -0500 From: Tom Lane To: gregk@stoddarts.com.au cc: pgsql-bugs@lists.postgresql.org 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> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Mon, 07 Jan 2019 03:52:26 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13026.1546837948.1@sss.pgh.pa.us> Date: Mon, 07 Jan 2019 00:12:28 -0500 Message-ID: <13027.1546837948@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > 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,'[]'); Hm, this example works for me in HEAD and 11 branch tip, so I'm guessing it was fixed by this commit: https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=595220a3a That'll be out in 11.2, or you can apply the patch locally if you're in a hurry. regards, tom lane