pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix walsender error cleanup code
Date: Sat, 16 May 2020 00:02:19 +0000
Message-ID: <E1jZkHT-0001cv-AL@gemulon.postgresql.org> (raw)

Fix walsender error cleanup code

In commit 850196b610d2 I (Álvaro) failed to handle the case of walsender
shutting down on an error before setting up its 'xlogreader' pointer;
the error handling code dereferences the pointer, causing a crash.
Fix by testing the pointer before trying to dereference it.

Kyotaro authored the code fix; I adopted Nathan's test case to be used
by the TAP tests and added the necessary PostgresNode change.

Reported-by: Nathan Bossart <bossartn@amazon.com>
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/C04FC24E-903D-4423-B312-6910E4D846E5@amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1d3743023ef8fa665902e791b0d52e9a1ab419cb

Modified Files
--------------
src/backend/replication/walsender.c         |  2 +-
src/test/perl/PostgresNode.pm               | 17 +++++++++++++++--
src/test/recovery/t/006_logical_decoding.pl | 13 +++++++++++--
3 files changed, 27 insertions(+), 5 deletions(-)



Message-ID: <E1jZkHT-0001cv-AL@gemulon.postgresql.org>
Permalink:  ../E1jZkHT-0001cv-AL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jZkHT-0001cv-AL@gemulon.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-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Fix walsender error cleanup code
  In-Reply-To: <E1jZkHT-0001cv-AL@gemulon.postgresql.org>
  References: <E1jZkHT-0001cv-AL@gemulon.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