pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id(
2+ messages / 1 participants
[nested] [flat]

* pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id(
@ 2021-08-19 12:20 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2021-08-19 12:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe.

Previously log messages late during shutdown could end up using either another
backend's PgBackendStatus (multi user) or segfault (single user) because
pgstat_get_my_query_id()'s check for !MyBEEntry didn't filter out use after
pgstat_beshutdown_hook().

This became a bug in 4f0b0966c86, but was a bit fishy before. But given
there's no known problematic cases before 14, it doesn't seem worth
backpatching further.

Also fixes a wrong filename in a comment, introduced in e1025044.

Reported-By: Andres Freund <andres@anarazel.de>
Reviewed-By: Julien Rouhaud <rjuju123@gmail.com>
Discussion: https://postgr.es/m/Julien Rouhaud <rjuju123@gmail.com>
Backpatch: 14-

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bed5eac2d50eb86a254861dcdea7b064d10c72cf

Modified Files
--------------
src/backend/utils/activity/backend_status.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id(
@ 2021-08-19 12:20 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2021-08-19 12:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe.

Previously log messages late during shutdown could end up using either another
backend's PgBackendStatus (multi user) or segfault (single user) because
pgstat_get_my_query_id()'s check for !MyBEEntry didn't filter out use after
pgstat_beshutdown_hook().

This became a bug in 4f0b0966c86, but was a bit fishy before. But given
there's no known problematic cases before 14, it doesn't seem worth
backpatching further.

Also fixes a wrong filename in a comment, introduced in e1025044.

Reported-By: Andres Freund <andres@anarazel.de>
Reviewed-By: Julien Rouhaud <rjuju123@gmail.com>
Discussion: https://postgr.es/m/Julien Rouhaud <rjuju123@gmail.com>
Backpatch: 14-

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/18914f24ec6e704e81a5528cf09f3d54b23ef12b

Modified Files
--------------
src/backend/utils/activity/backend_status.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-08-19 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:20 pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id( Andres Freund <andres@anarazel.de>
2021-08-19 12:20 pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id( Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox