Re: BUG #15312: Possible access to unintended variable in "postgres/src/backend/postmaster/pgstat.c" line 2698

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: pgsql-bugs@lists.postgresql.org
Cc: petrum@gmail.com, Robert Haas <robertmhaas@gmail.com>, Marti Raudsepp <marti@juffo.org>
Date: 2018-08-07T15:31:21Z
Lists: pgsql-bugs
On 2018-Aug-07, PG Bug reporting form wrote:

> While experimenting with a CodeSonar plugin we develop, we noticed a
> potential bug in file "postgres/src/backend/postmaster/pgstat.c" line 2698
> function CreateSharedBackendStatus.

Hmm, yeah this is a bug, introduced by commit c8e8b5a6e20b AFAICS.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Fix incorrect initialization of BackendActivityBuffer.

  2. Try to log current the query string when a backend crashes.