[pgpool-committers: 9497] pgpool: Install system exit callback only after initialization of share

Muhammad Usama m.usama at gmail.com
Mon Jul 24 03:00:26 JST 2023


Install system exit callback only after initialization of shared memory.

When the on-exit callback gets called because of a failure to acquire
shared memory. The cleanup function can produce a segfault while accessing
process_info, that lives in shared memory.
Although we can also fix this by bailing out from the exit callback when
process_info is NULL but installing the function after successful initialization
of shared memory is a better approach as the rest of the system always assumes
the process_info can never be NULL, and also, there is nothing to
clean up before child processes are spawned.

Branch
------
V4_3_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=925810e79008e839f3281d85ad75ba2daa942ca8

Modified Files
--------------
src/main/pgpool_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)



More information about the pgpool-committers mailing list