Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc3f445

Browse files
committed
Recompute stack base in forked postmaster children.
This is for the benefit of running postgres under the rrdebugger. When using rr signal handlers running while a syscall isactive use an alternative stack. As e.g. bgworkers are started fromwithin signal handlers, the forked backend then has a different stackbase than postmaster. Previously that subsequently lead to thoseprocesses triggering spurious "stack depth limit exceeded" errors.Discussion:https://postgr.es/m/20200327182217.ubrrl32lyfhxfwk5@alap3.anarazel.de
1 parentf946069 commitfc3f445

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4900,11 +4900,6 @@ SubPostmasterMain(int argc, char *argv[])
49004900
/* Close the postmaster's sockets (as soon as we know them) */
49014901
ClosePostmasterPorts(strcmp(argv[1],"--forklog")==0);
49024902

4903-
/*
4904-
* Set reference point for stack-depth checking
4905-
*/
4906-
set_stack_base();
4907-
49084903
/*
49094904
* Set up memory area for GSS information. Mirrors the code in ConnCreate
49104905
* for the non-exec case.

‎src/backend/utils/init/miscinit.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ InitPostmasterChild(void)
9292
{
9393
IsUnderPostmaster= true;/* we are a postmaster subprocess now */
9494

95+
/*
96+
* Set reference point for stack-depth checking. We re-do that even in the
97+
* !EXEC_BACKEND case, because there are some edge cases where processes
98+
* are started with an alternative stack (e.g. starting bgworkers when
99+
* running postgres using the rr debugger, as bgworkers are launched from
100+
* signal handlers).
101+
*/
102+
set_stack_base();
103+
95104
InitProcessGlobals();
96105

97106
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp