pgsql: Fix crash when reporting CREATE INDEX progress

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix crash when reporting CREATE INDEX progress
Date: 2019-10-16 12:53:22
Message-ID: E1iKinq-0004EZ-Ke@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix crash when reporting CREATE INDEX progress

A race condition can make us try to dereference a NULL pointer to the
PGPROC struct of a process that's already finished. That results in
crashes during REINDEX CONCURRENTLY and CREATE INDEX CONCURRENTLY.

This was introduced in ab0dfc961b6a, so backpatch to pg12.

Reported by: Justin Pryzby
Reviewed-by: Michaël Paquier
Discussion: https://postgr.es/m/20191012004446.GT10470@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0d21f919eb86cd3baa267844d111c6a5af480696

Modified Files
--------------
src/backend/commands/indexcmds.c | 6 ++++--
src/backend/storage/lmgr/lmgr.c | 10 ++++------
2 files changed, 8 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2019-10-16 14:32:01 pgsql: Add missing include to pg_upgrade/version.c
Previous Message Tomas Vondra 2019-10-16 11:32:00 pgsql: Improve the check for pg_catalog.line data type in pg_upgrade