summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorTom Lane2022-06-14 22:16:46 +0000
committerTom Lane2022-06-14 22:16:46 +0000
commitba412c905af14699a128a7bcd8ce5234adb93ceb (patch)
tree6f86ac7383076693441426ead925605cd98df184 /src/backend/access/gist/gist.c
parentd26ac35d0d7cb42a0453e69e0e9ce6d163b55927 (diff)
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/[email protected]
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions