pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marks Polakovs <marks-mailinglists@markspolakovs.me>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: UPDATE with json_populate_recordset empty array crashes server
Date: Wed, 31 Jul 2019 11:55:14 +0300
Message-ID: <16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me> (raw)

Hi,



The following sequence of commands causes a reproducible backend crash:

$ createdb test 

$ psql test

test=# CREATE TABLE test (foo text);

test=# WITH json_cte AS (SELECT * FROM json_populate_recordset(null::test, '[]'))

test-# UPDATE test

test-# SET foo = json_cte.foo

test-# FROM json_cte;

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.



Here's the postgres output:

wrote crash dump to file "crashdumps\postgres-pid14356-221788734.mdmp" 



2019-07-31 10:45:17.989 CEST [1744] LOG:  server process (PID 14356) was terminated by exception 0xC0000005

2019-07-31 10:45:17.989 CEST [1744] DETAIL:  Failed process was running: WITH json_cte AS (SELECT * FROM json_populate_recordset(null::test, '[]'))

        UPDATE test

        SET foo = json_cte.foo

        FROM json_cte;

2019-07-31 10:45:17.989 CEST [1744] HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value.

2019-07-31 10:45:17.990 CEST [1744] LOG:  terminating any other active server processes

2019-07-31 10:45:18.016 CEST [18716] WARNING:  terminating connection because of crash of another server process

2019-07-31 10:45:18.016 CEST [18716] 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-07-31 10:45:18.016 CEST [18716] HINT:  In a moment you should be able to reconnect to the database and repeat your command.

2019-07-31 10:45:18.073 CEST [1744] LOG:  all server processes terminated; reinitializing

2019-07-31 10:45:18.174 CEST [4436] FATAL:  the database system is in recovery mode

2019-07-31 10:45:18.177 CEST [1724] LOG:  database system was interrupted; last known up at 2019-07-31 10:39:13 CEST

2019-07-31 10:45:30.266 CEST [1724] LOG:  database system was not properly shut down; automatic recovery in progress

2019-07-31 10:45:30.303 CEST [1724] LOG:  redo starts at 0/B4F00530

2019-07-31 10:45:30.303 CEST [1724] LOG:  invalid record length at 0/B4F00568: wanted 24, got 0

2019-07-31 10:45:30.307 CEST [1724] LOG:  redo done at 0/B4F00530

2019-07-31 10:45:30.501 CEST [1744] LOG:  database system is ready to accept connections



VERSION(): PostgreSQL 11.1, compiled by Visual C++ build 1914, 64-bit

Running on Windows 10.0.17134.885



Crash dump is attached.



All the best,

Marks

Attachments:

  postgres-pid14356-221788734.mdmp (application/octet-stream, 3.9M) download

view thread (3+ messages)  latest in thread

Message-ID: <16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me>
Permalink:  ../16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me/
Also on:    postgresql.org/message-id/16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me

 · 

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: marks-mailinglists@markspolakovs.me
  Subject: Re: UPDATE with json_populate_recordset empty array crashes server
  In-Reply-To: <16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me>
  References: <16c473d9703.bcae5a61323706.3752002245992279523@markspolakovs.me>

* 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