[pgpool-committers: 9979] pgpool: Fix another segmentation fault.

Tatsuo Ishii ishii at postgresql.org
Mon Jul 22 19:47:20 JST 2024


Fix another segmentation fault.

It is reported that pgpool child segfaulted in pool_do_auth. The cause
was MAIN_CONNECTION() returns NULL. It seems my_main_node_id was set
to incorrect node id 0, which was actually in down status. thus there
was no connection in cp->slots[0]. In this particular case a client
connected to pgpool while failover occurred in another pgpool node,
and it was propagated by watchdog, which changed backend_status in
shared memory. new_connection() properly updates my_backend_status but
it forgot to update my_main_node_id, and MAIN_CONNECTION returned
incorrect backend id.

Problem reported by: Emond Papegaaij
Discussion: [pgpool-general: 9175] Segmentation fault
https://www.pgpool.net/pipermail/pgpool-general/2024-July/001852.html
Backpatch-through: V4.1.

Branch
------
master

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

Modified Files
--------------
src/protocol/pool_connection_pool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list