Adjust obsolete comment explaining set_stack_base().
authorThomas Munro <[email protected]>
Fri, 1 Dec 2023 01:58:40 +0000 (14:58 +1300)
committerThomas Munro <[email protected]>
Fri, 1 Dec 2023 02:18:51 +0000 (15:18 +1300)
Commit 7389aad6 removed the notion of backends started from inside a
signal handler.  A stray comment still referred to them, while
explaining the need for a call to set_stack_base().  That leads to the
question of whether we still need the call in !EXEC_BACKEND builds.
There doesn't seem to be much point in suppressing it now, as it doesn't
hurt and probably helps to measure the stack base from the exact same
place in EXEC_BACKEND and !EXEC_BACKEND builds.

Back-patch to 16.

Reported-by: Heikki Linnakangas <[email protected]>
Reported-by: Tristan Partin <[email protected]>
Reported-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/CA%2BhUKG%2BEJHcevNGNOxVWxTNFbuB%3Dvjf4U68%2B85rAC_Sxvy2zEQ%40mail.gmail.com

src/backend/utils/init/miscinit.c

index cfc5afaa6fd7046aaae9bb3f4e2a6345c09b53fc..819936ec0246c723efe9a8cd86e018850ad5afc9 100644 (file)
@@ -107,9 +107,8 @@ InitPostmasterChild(void)
 
    /*
     * Set reference point for stack-depth checking.  This might seem
-    * redundant in !EXEC_BACKEND builds; but it's not because the postmaster
-    * launches its children from signal handlers, so we might be running on
-    * an alternative stack.
+    * redundant in !EXEC_BACKEND builds, but it's better to keep the depth
+    * logic the same with and without that build option.
     */
    (void) set_stack_base();