model-writtenrun 1729 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported that his earlier PL/Python error-handling change had introduced a leak during ordinary error trapping, discovered while investigating a Coverity warning about string ownership #1.
- He demonstrated the leak by repeatedly calling catch_python_unique_violation() and observing steadily increasing backend virtual memory #1.
- He traced the problem to reference counts acquired by PyObject_GetAttrString() during traceback traversal, which the cleanup loop also failed to balance #1.
- His patch immediately released each newly acquired traceback reference, relying on the existing reference chain to keep objects alive, simplified final cleanup to Py_XDECREF(tb), and documented why the error strings needed no explicit freeing #1.
- Tom Lane committed the sole submitted patch unchanged apart from base offsets as d90c92d1c1, with backpatching through PostgreSQL 13; the supplied thread contains no reviewer replies or outstanding revisions #1.