Re: BUG #18312: libpq: PQsetdbLogin() not thread-safe

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Maurer <c.maurer@gmx.at>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2024-02-02T18:19:42Z
Lists: pgsql-bugs

Attachments

Christian Maurer <c.maurer@gmx.at> writes:
>> I wondered whether we needed to introduce a critical section
>> to prevent multiple threads from calling that concurrently,
>> even though its docs allege you shouldn't have to. Perhaps
>> it's thread-safe except on Windows?

> This would explain, why I could not reproduce the error on Red Hat Enterprise Linux.

Are you in a position to try a source-code patch?  The attached
is very quick-and-dirty, but if it resolves your problem then
we could turn it into something respectable.

			regards, tom lane

Commits

  1. Avoid concurrent calls to bindtextdomain().