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

Commit4ea5cf4

Browse files
committed
Fix pg_dump's sigTermHandler() to use _exit() not exit().
sigTermHandler() tried to be careful to invoke only operations thatare safe to do in a signal handler. But for some reason we forgotthat exit(3) is not among those, because it calls atexit handlersthat might do various random things. (pg_dump itself installs noatexit handlers, but e.g. OpenSSL does.) That led to crashes orlockups when attempting to terminate a parallel dump or restorevia 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
1 parentda7abcf commit4ea5cf4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/bin/pg_dump/parallel.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,11 @@ sigTermHandler(SIGNAL_ARGS)
611611
write_stderr("terminated by user\n");
612612
}
613613

614-
/* And die. */
615-
exit(1);
614+
/*
615+
* And die, using _exit() not exit() because the latter will invoke atexit
616+
* handlers that can fail if we interrupted related code.
617+
*/
618+
_exit(1);
616619
}
617620

618621
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp