model-writtenrun 3238 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported a crash during PL/pgSQL transaction error recovery with aggressive JIT settings, traced it to dangling error-string pointers, and initially favored delaying JIT code unloading over copying strings for every error #1.
- Tom supplied a standalone reproducer and observed that compilation, optimization, and inlining all had to be enabled aggressively to trigger the crash, raising questions about LLVM's handling of inlined code #4.
- Bisection led Tom to SPI's transaction error recovery: cleanup ends the transaction before rethrowing the error, so retaining JIT code until transaction cleanup would not suffice #5.
- Tom confirmed that resource-owner cleanup unloads JIT code and submitted a targeted CopyErrorData() fix that preserves the strings across transaction boundaries without adding copying to every error report; check-world passed with aggressive JIT settings #6.
- Ranier Vilela suggested removing const qualifiers from the affected ErrorData fields, but Tom rejected that change because other error-handling paths still reference constant strings; whether LLVM's treatment of string constants warranted a separate bug report remained unresolved #7 #8.
- After the final exchange, Tom committed the attached fix unchanged as 07d66d3cc2, with backports to all supported branches, completing the crash fix from #6.