model-writtenrun 7087 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ranier Vilela opened the thread with a Coverity-reported dbname leak and inconsistent freeing of libpq escape results in pg_createsubscriber #1.
- Euler Taveira supported the cleanup while initially describing the allocator substitutions as equivalent #2, and Michael Paquier agreed on consistency grounds #3; the original patch landed unchanged as 5b94e27534.
- Andres Freund explained that shared libraries and executables can use different allocators on Windows #5, and Tom Lane emphasized that common build configurations can conceal these bugs #6.
- Ranier's subsequent manual audit produced the pg_amcheck schema deallocation fix, while leaving the separately mentioned, never-freed amcheck_schema allocation untouched #7.
- Andres demonstrated GCC allocator/deallocator attributes detecting these mismatches #8; discussion with Dagfinn Ilmari Mannsåker and Tom favored explicit compiler capability checks and an opt-in guard to preserve libpq header compatibility, but produced no committed implementation here #9 #10 #11 #12 #14.
- Tom supplied an experimental dmalloc-based libpq patch that exposed allocator mixing in initdb and argued that comprehensive cleanup would be impractical #13.
- Michael combined Ranier's pg_amcheck fix with a new pg_upgrade fix that selected the deallocator according to how datlocale_literal was allocated #16.
- Tom's further testing exposed extensive PQExpBuffer allocation mixing in psql #18, prompting Michael to pause the utility changes while considering a broader solution #19.
- Two weeks later Michael revived the targeted fixes #21, and Ranier proposed replacing pg_upgrade's pg_strdup("NULL") with PQescapeLiteral() to avoid mixed allocation APIs #22.
- The pg_amcheck fix first attached here in #7 and included in #16 landed as 48e4ae9a07 from the later matching submission #583257 in thread #51093, which supersedes this thread as the commit's source.
- Michael suggested an intermediate input variable #24, Ranier incorporated it #25, and Michael reduced the diff slightly before committing 2a083ab807 and reporting backpatches through PostgreSQL 16 #26.
- Noah Misch later reported that the pg_upgrade commit escaped "NULL" into a quoted string, causing datlocale to contain textual 'NULL' instead of SQL NULL #28.
- After Ranier questioned the intended SQL syntax #29 #30, Noah clarified the behavioral regression #31; all three targeted fixes had landed, but no corrective patch or revert appears before Michael's final image-only reply #32, and the broader allocator-checking work remained experimental.