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

Commit075dc25

Browse files
committed
Fix kill() call in elog() so that it gets its own pid by calling getpid().
MyProcPid global variable is set to 0 when postgres starts as a command(not as a backend daemon). This leads issuing SIGQUIT to the process group,not the process itself. As a result, parent sh gets core dumped in theWisconsin benchmark test.
1 parente062a17 commit075dc25

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.39 1999/02/13 23:19:47 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.40 1999/04/16 06:38:17 ishii Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -221,7 +221,11 @@ elog(int lev, const char *fmt,...)
221221
ProcReleaseSpins(NULL);/* get rid of spinlocks we hold */
222222
if (!InError)
223223
{
224-
kill(MyProcPid,SIGQUIT);/* abort to traffic cop */
224+
if (MyProcPid==0) {
225+
kill(getpid(),SIGQUIT);
226+
}else {
227+
kill(MyProcPid,SIGQUIT);/* abort to traffic cop */
228+
}
225229
pause();
226230
}
227231

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp