model-writtenrun 5294 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- James Inform reported a PostgreSQL 14.5 crash involving ICU-collated sorting and supplied reproduction SQL; Euler Taveira requested the missing data attachment and environment details #1 #2.
- After obtaining the test case, Tom Lane traced memory corruption to varstr_abbrev_convert enlarging buffers in a potentially shorter-lived memory context and posted a draft using the SortSupport context, with diagnostic assertions intended to be omitted from the final fix #5.
- Peter Geoghegan audited other SortSupport allocations and recommended repalloc because buffer growth is uncommon; after Peter and Tom checked that cache invalidation already followed from new input, Tom accepted repalloc as the safer implementation #6 #7 #8 #9.
- Tom investigated missing regression coverage, and Peter explained that locale-aware abbreviation normally trusts ICU but disables libc strxfrm; Tom then confirmed that ICU-enabled tests still missed both faulty buffer-growth paths and considered the submitted reproducer too large for a regression test #10 #11 #12.
- Tom committed the draft's fix with moderate local changes: all four growth sites in varstr_abbrev_convert and varstrfastcmp_locale now use repalloc, preserving allocation contexts and buffer contents without the draft's assertions; the fix was also backported #5 a466219428.
- After the commit, Peter discussed why ICU's abbreviated-key interface could make a small reproducer difficult, and Tom added that incremental sort likely also mattered and confirmed that both functions already used repalloc; the fix had landed, while a compact regression test remained unresolved #13 #14.