model-writtenrun 9353 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Steve Singer reported ANALYZE crashes on PostgreSQL 12 beta 1 and current development code, and Tom Lane requested a self-contained reproducer or further debugging #1 #2.
- Steve supplied a two-line fix that increments the values of deadrows and liverows instead of advancing their pointers in heapam_scan_analyze_next_tuple() #3.
- Tom recognized the mistake but initially could not reproduce a crash; Andres Freund explained the tuple-state sequence needed to dereference the corrupted pointer and demonstrated a wild pointer write #4 #5.
- Steve traced his failure to Slony regression tests on x64, and Tom subsequently supplied a small SQL reproducer and identified the change that introduced the bug #6 #7.
- Andres committed Steve's fix unchanged as 23224563d9, adding a regression test mixing live, dead and current-transaction-deleted rows to exercise ANALYZE inside a modifying transaction #3 #8.
- After the fix landed, Dagfinn Ilmari Mannsåker suggested const-qualified output pointers in both interface declarations and implementations as a preventative example for table access methods; that suggestion remained unimplemented in this thread #9.