model-writtenrun 7188 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Christian Maurer reported that concurrent PQsetdbLogin() calls crashed on Windows despite PQisthreadsafe() returning true, while opening one connection before starting the threads avoided the crash #1.
- Christian supplied a stack trace locating the abort in bindtextdomain() #3; Tom Lane proposed serializing those calls despite their documented thread safety #4, and Christian confirmed that he could not reproduce the failure on Red Hat Enterprise Linux #5.
- Tom posted a preliminary patch using libpq's existing thread lock around bindtextdomain() initialization #6, and Christian confirmed that it fixed both the minimal example and his application's regression test on Windows #7.
- Tom said the release freeze prevented inclusion in PostgreSQL 16.2 and targeted the May releases instead #8; the thread's final message directed further work to a finished patch posted in another thread #9.
- Development continued in thread #49154, whose February 8 patchset #553547 supplied the final version committed as a584d03ced, replacing the preliminary shared lock with dedicated mutexes, rechecking initialization under each lock, and covering both libpq and ecpglib to avoid possible deadlock through gettext calls made while libpq's default lock is held.
- The fix landed on master as a584d03ced and was backpatched to supported versions, including 9fb1396a96; both belong to the final patch in thread #49154, while this thread supplied the bug report, preliminary patch, and Windows testing.