Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d6de430

Browse files
committed
Don't unblock SIGQUIT in the SIGQUIT handler
This was possibly linked to a deadlock-like situation in glibc syslog code invoked by the ereport call in quickdie(). In any case, a signal handler should not unblock its own signal unless there is a specific reason to.
1 parent b63b967 commit d6de430

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/backend/tcop/postgres.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.577 2009/12/16 22:55:33 petere Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.578 2009/12/16 23:05:00 petere Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -2538,6 +2538,7 @@ drop_unnamed_stmt(void)
25382538
void
25392539
quickdie(SIGNAL_ARGS)
25402540
{
2541+
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
25412542
PG_SETMASK(&BlockSig);
25422543

25432544
/*

src/include/libpq/pqsignal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.35 2009/12/16 22:55:34 petere Exp $
10+
* $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.36 2009/12/16 23:05:00 petere Exp $
1111
*
1212
* NOTES
1313
* This shouldn't be in libpq, but the monitor and some other
@@ -38,6 +38,7 @@ extern int UnBlockSig,
3838
int pqsigsetmask(int mask);
3939
#endif
4040

41+
#define sigaddset(set, signum) (*(set) |= (sigmask(signum)))
4142
#define sigdelset(set, signum) (*(set) &= ~(sigmask(signum)))
4243
#endif /* not HAVE_SIGPROCMASK */
4344

0 commit comments

Comments
 (0)