Re: Fix for pg_stat_activity putting client hostaddr into appname field
Edmund Horner <ejrh00@gmail.com>
From: Edmund Horner <ejrh00@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Robert Haas <robertmhaas@gmail.com>, kuntalghosh.2007@gmail.com
Date: 2018-04-05T22:46:27Z
Lists: pgsql-hackers
On 29 March 2018 at 20:46, Michael Paquier <michael@paquier.xyz> wrote: > On Tue, Mar 27, 2018 at 03:47:07PM +1300, Edmund Horner wrote: >> But the stats array includes auxiliary processes, which means it has >> NumBackendStatSlots items. The pointers for the aux process strings >> are out of range. In the case of my query, the pointers for >> st_appname in the aux processes happen to point into the >> BackendClientHostnameBuffer segment. >> >> This patch uses NumBackendStatSlots for the sizes of those segments, >> rather than MaxBackends. > > I am adding in CC Robert and Kuntal who worked on that (issue added as > well to the older bug section in v11 open item list). Thanks for making a note of it, Michael. I guess it should be considered for the next patch release of v10 too?
Commits
-
Allocate enough shared string memory for stats of auxiliary processes.
- 93b3d43dc188 10.4 landed
- 811969b218ac 11.0 landed
-
Make local copy of client hostnames in backend status array.
- dfc383cf3975 9.3.23 landed
- 310d1379dd71 9.4.18 landed
- fd2efda5d6f1 9.5.13 landed
- 74dc05e01e5a 9.6.9 landed
- 89c2ab340398 10.4 landed
- a820b4c32946 11.0 landed
-
Show more processes in pg_stat_activity.
- fc70a4b0df38 10.0 cited