pgsql: Fix possible crash reading pg_stat_activity.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible crash reading pg_stat_activity.
Date: 2017-01-05 17:31:43
Message-ID: E1cPBt9-0003R1-9h@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Fix possible crash reading pg_stat_activity.

With the old code, a backend that read pg_stat_activity without ever
having executed a parallel query might see a backend in the midst of
executing one waiting on a DSA LWLock, resulting in a crash. The
solution is for backends to register the tranche at startup time, not
the first time a parallel query is executed.

Report by Andreas Seltenreich. Patch by me, reviewed by Thomas Munro.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/175ff6598e014b2fe84c06fa443161294fc2eed0

Modified Files
--------------
src/backend/executor/execParallel.c | 1 -
src/backend/storage/lmgr/lwlock.c | 2 ++
src/backend/utils/mmgr/dsa.c | 28 +++++++---------------------
src/include/utils/dsa.h | 5 ++---
4 files changed, 11 insertions(+), 25 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-01-05 17:34:57 pgsql: Use 'use strict' in all Perl programs
Previous Message Tom Lane 2017-01-05 16:34:11 pgsql: Fix handling of empty arrays in array_fill().

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-01-05 17:31:52 Re: [sqlsmith] Crash reading pg_stat_activity
Previous Message Stephen Frost 2017-01-05 17:28:04 Re: ALTER SYSTEM for pg_hba.conf