aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-06-14 18:16:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-06-14 18:16:46 -0400
commit9a3aab0f2a5b2467470282a7c9d5b285ed383261 (patch)
tree652c6a0a6c73f01bf25fada9847fc23946cb9090 /src/backend/tcop/postgres.c
parentcc5de7ba255dad24e57fd77578a70581a17a8b2c (diff)
downloadpostgresql-9a3aab0f2a5b2467470282a7c9d5b285ed383261.tar.gz
postgresql-9a3aab0f2a5b2467470282a7c9d5b285ed383261.zip
Avoid ecpglib core dump with out-of-order operations.
If an application executed operations like EXEC SQL PREPARE without having first established a database connection, it could get a core dump instead of the expected clean failure. This occurred because we did "pthread_getspecific(actual_connection_key)" without ever having initialized the TSD key actual_connection_key. The results of that are probably platform-specific, but at least on Linux it often leads to a crash. To fix, add calls to ecpg_pthreads_init() in the code paths that might use actual_connection_key uninitialized. It's harmless (and hopefully inexpensive) to do that more than once. Per bug #17514 from Okano Naoki. The problem's ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/17514-edd4fad547c5692c@postgresql.org
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions