summaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/option.c
diff options
context:
space:
mode:
authorFujii Masao2025-12-19 03:05:37 +0000
committerFujii Masao2025-12-19 03:05:37 +0000
commitb3ccb0a2cb2ef53571021d6c8f9b70809a6bf20c (patch)
treeb80e090e90023738bd344c68c16fb708f093d05a /src/bin/pg_upgrade/option.c
parent9d0f7996e58c2a92efe06c901c6dfe1f6ced0a1d (diff)
Add guard to prevent recursive memory context logging.HEADmaster
Previously, if memory context logging was triggered repeatedly and rapidly while a previous request was still being processed, it could result in recursive calls to ProcessLogMemoryContextInterrupt(). This could lead to infinite recursion and potentially crash the process. This commit adds a guard to prevent such recursion. If ProcessLogMemoryContextInterrupt() is already in progress and logging memory contexts, subsequent calls will exit immediately, avoiding unintended recursive calls. While this scenario is unlikely in practice, it's not impossible. This change adds a safety check to prevent such failures. Back-patch to v14, where memory context logging was introduced. Reported-by: Robert Haas <[email protected]> Author: Fujii Masao <[email protected]> Reviewed-by: Atsushi Torikoshi <[email protected]> Reviewed-by: Robert Haas <[email protected]> Reviewed-by: Artem Gavrilov <[email protected]> Discussion: https://postgr.es/m/CA+TgmoZMrv32tbNRrFTvF9iWLnTGqbhYSLVcrHGuwZvCtph0NA@mail.gmail.com Backpatch-through: 14
Diffstat (limited to 'src/bin/pg_upgrade/option.c')
0 files changed, 0 insertions, 0 deletions