From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix race condition in gettext() initialization in libpq and ecpg |
Date: | 2022-01-21 20:36:44 |
Message-ID: | E1nB0eK-0003Mj-HP@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/64ebb43df068e3a9c01beeaacf7842080c43e712
Modified Files
--------------
src/interfaces/ecpg/ecpglib/misc.c | 11 +++++++++--
src/interfaces/libpq/fe-misc.c | 11 +++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-01-22 18:32:59 | pgsql: Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING |
Previous Message | Andres Freund | 2022-01-21 19:49:46 | pgsql: fsync pg_logical/mappings in CheckPointLogicalRewriteHeap(). |