Commit d6de4309 authored by Peter Eisentraut's avatar Peter Eisentraut

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.
parent b63b967a
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.577 2009/12/16 22:55:33 petere Exp $ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.578 2009/12/16 23:05:00 petere Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
...@@ -2538,6 +2538,7 @@ drop_unnamed_stmt(void) ...@@ -2538,6 +2538,7 @@ drop_unnamed_stmt(void)
void void
quickdie(SIGNAL_ARGS) quickdie(SIGNAL_ARGS)
{ {
sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */
PG_SETMASK(&BlockSig); PG_SETMASK(&BlockSig);
/* /*
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.35 2009/12/16 22:55:34 petere Exp $ * $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.36 2009/12/16 23:05:00 petere Exp $
* *
* NOTES * NOTES
* This shouldn't be in libpq, but the monitor and some other * This shouldn't be in libpq, but the monitor and some other
...@@ -38,6 +38,7 @@ extern int UnBlockSig, ...@@ -38,6 +38,7 @@ extern int UnBlockSig,
int pqsigsetmask(int mask); int pqsigsetmask(int mask);
#endif #endif
#define sigaddset(set, signum) (*(set) |= (sigmask(signum)))
#define sigdelset(set, signum) (*(set) &= ~(sigmask(signum))) #define sigdelset(set, signum) (*(set) &= ~(sigmask(signum)))
#endif /* not HAVE_SIGPROCMASK */ #endif /* not HAVE_SIGPROCMASK */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment