model-writtenrun 5587 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Guillaume Lelarge reported an ECPG cursor-fetch loop that consumed memory and crashed on AIX while working on Linux, supplying a reproducer #1; Justin Pryzby requested evidence distinguishing a leak from a crash #2.
- Noah Misch explained AIX's default 32-bit heap limit #4, and Benoit Lobréau confirmed that memory consumption increased with fetching while explicit heap settings avoided the segfault #6.
- Noah reproduced the leak in AIX's newlocale()/freelocale() cycle, recommended reporting the platform bug, and proposed allocating the locale once per process or connection #7.
- Tom Lane identified ECPGget_desc() as another affected path and argued that reducing allocation also saved CPU work #8; Noah chose once-per-process allocation despite retaining the locale for the process lifetime #9.
- Noah submitted the patch initializing the shared locale while ECPGconnect() holds connections_mutex, rejecting pthread_once() because failures needed to be reported and retried; he also tested configurations without uselocale() and with persistent newlocale() failure #13.
- Tom approved the implementation and requested a comment explaining its mutex protection #14; Noah incorporated that comment and committed the patch as 5633836ef3, with backports to all supported versions.
- After landing, prairiedog exposed a ppc Darwin linker rejection of the uninitialized global ecpg_clocale, prompting Noah to propose an inline explicit-zero initializer and discuss -fno-common as an alternative #15.
- Tom tested both alternatives successfully for the ecpglib build, without running a full-system test, and recommended explicit initialization #19; Noah committed that exact inline fix as e2bc242833.
- The thread ended with Noah confirming that the follow-up was pushed and results remained clean, leaving both the locale-allocation change and its portability fix landed #20.