postgresql/src
Tom Lane 64ebb43df0 Fix race condition in gettext() initialization in libpq and ecpglib.
In libpq and ecpglib, multiple threads can concurrently enter the
initialization logic for message localization.  Since we set the
its-done flag before actually doing the work, it'd be possible
for some threads to reach gettext() before anyone has called
bindtextdomain().  Barring bugs in libintl itself, this would not
result in anything worse than failure to localize some early
messages.  Nonetheless, it's a bug, and an easy one to fix.

Noted while investigating bug #17299 from Clemens Zeidler
(much thanks to Liam Bowen for followup investigation on that).
It currently appears that that actually *is* a bug in libintl itself,
but that doesn't let us off the hook for this bit.

Back-patch to all supported versions.

Discussion: https://postgr.es/m/17299-7270741958c0b1ab@postgresql.org
Discussion: https://postgr.es/m/CAE7q7Eit4Eq2=bxce=Fm8HAStECjaXUE=WBQc-sDDcgJQ7s7eg@mail.gmail.com
2022-01-21 15:36:28 -05:00
..
backend fsync pg_logical/mappings in CheckPointLogicalRewriteHeap(). 2022-01-21 11:24:12 -08:00
bin Fix psql \d's query for identifying parent triggers. 2022-01-17 21:18:49 -05:00
common Fix buffer overrun in unicode string normalization with empty input 2021-11-11 15:01:54 +09:00
fe_utils Avoid calling gettext() in signal handlers. 2022-01-17 13:30:04 -05:00
include Fix index-only scan plans, take 2. 2022-01-03 15:42:27 -05:00
interfaces Fix race condition in gettext() initialization in libpq and ecpglib. 2022-01-21 15:36:28 -05:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Remove unneeded Python includes 2021-11-25 14:30:46 +01: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 Tighten TAP tests' tracking of postmaster state some more. 2022-01-20 17:28:07 -05:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:38 -04:00
tools Allow clean.bat to be run from anywhere 2022-01-20 10:20:51 -05:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile
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