pgsql: Fix pg_dump's sigTermHandler() to use _exit() not exit(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix pg_dump's sigTermHandler() to use _exit() not exit().
Date
Msg-id E1itbJ1-0002mN-Aw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_dump's sigTermHandler() to use _exit() not exit().

sigTermHandler() tried to be careful to invoke only operations that
are safe to do in a signal handler.  But for some reason we forgot
that exit(3) is not among those, because it calls atexit handlers
that might do various random things.  (pg_dump itself installs no
atexit handlers, but e.g. OpenSSL does.)  That led to crashes or
lockups when attempting to terminate a parallel dump or restore
via a signal.

Fix by calling _exit() instead.

Per bug #16199 from Raúl Marín.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/16199-cb2f121146a96f9b@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6f6daa1be78503ee3d171d28ed9f6843cc53d129

Modified Files
--------------
src/bin/pg_dump/parallel.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix crash in BRIN inclusion op functions, due to missing datum c
Next
From: Tom Lane
Date:
Subject: pgsql: Further tweaking of jsonb_set_lax().