postgresql/src
Tom Lane 12b8fb34a9 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
2022-06-14 18:16:46 -04:00
..
backend Un-break whole-row Vars referencing domain-over-composite types. 2022-06-10 10:35:57 -04:00
bin Revert "Fix psql's single transaction mode on client-side errors with -c/-f switches". 2022-06-10 16:34:25 -04:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:50:01 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Repurpose PROC_COPYABLE_FLAGS as PROC_XMIN_FLAGS 2022-05-19 16:20:32 +02:00
interfaces Avoid ecpglib core dump with out-of-order operations. 2022-06-14 18:16:46 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Fix pl/perl test case so it will still work under Perl 5.36. 2022-06-01 16:15:47 -04:00
port AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:31 -05:00
test Un-break whole-row Vars referencing domain-over-composite types. 2022-06-10 10:35:57 -04:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:55:10 -04:00
tools Improve setup of environment values for commands in MSVC's vcregress.pl 2022-05-11 10:22:34 +09:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Fix prove_installcheck to use correct paths when used with PGXS 2021-07-01 08:46:38 -04:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00