pgsql: Fix rare core dump in BackendIdGetTransactionIds(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix rare core dump in BackendIdGetTransactionIds().
Date
Msg-id E1Ycd8A-0006dk-Eg@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix rare core dump in BackendIdGetTransactionIds().

BackendIdGetTransactionIds() neglected the possibility that the PROC
pointer in a ProcState array entry is null.  In current usage, this could
only crash if the other backend had exited since pgstat_read_current_status
saw it as active, which is a pretty narrow window.  But it's reachable in
the field, per bug #12918 from Vladimir Borodin.

Back-patch to 9.4 where the faulty code was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/701dcc983eb4d08dd36bb3a0ddba255819797760

Modified Files
--------------
src/backend/storage/ipc/sinvaladt.c |   15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix rare core dump in BackendIdGetTransactionIds().
Next
From: Tom Lane
Date:
Subject: pgsql: Be more careful about printing constants in ruleutils.c.