From: Peter Eisentraut Date: Wed, 16 Dec 2009 23:05:00 +0000 (+0000) Subject: Don't unblock SIGQUIT in the SIGQUIT handler X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=17f99595bcd8a7761764ee5447738adfddf86d38;p=users%2Fandresfreund%2Fpostgres.git 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. --- diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index c7906bfa1b..b2fb501882 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2538,6 +2538,7 @@ drop_unnamed_stmt(void) void quickdie(SIGNAL_ARGS) { + sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ PG_SETMASK(&BlockSig); /* diff --git a/src/include/libpq/pqsignal.h b/src/include/libpq/pqsignal.h index 82414d62d7..4659ae21d1 100644 --- a/src/include/libpq/pqsignal.h +++ b/src/include/libpq/pqsignal.h @@ -38,6 +38,7 @@ extern int UnBlockSig, int pqsigsetmask(int mask); #endif +#define sigaddset(set, signum) (*(set) |= (sigmask(signum))) #define sigdelset(set, signum) (*(set) &= ~(sigmask(signum))) #endif /* not HAVE_SIGPROCMASK */