Thread: LLVM version used for postgres packages on Centos 7 is very old and causes segfaults on OOM
LLVM version used for postgres packages on Centos 7 is very old and causes segfaults on OOM
From
Jelte Fennema
Date:
Hi,
Recently I ran into some segfaults under low memory conditions when enabling JIT. The reason turned out to be that the CentOS 7 packages for x86_64 are using LLVM 5, which is very old. Recompiling Postgres with LLVM 7 already helped quite a bit at reducing such crashes, presumably because it contains this change: https://github.com/llvm/llvm-project/commit/15681ad00b83c606dbb13af8782610a61bf39687
Looking at the spec files postgres is already built with LLVM 7 for ARM64 packages for CentOS 7.
Even with LLVM 7 there were still some segfaults related to out of memory issues in LLVM. The backtraces indicated that it would be fixed by this commit which is part of LLVM 8 and up: https://github.com/llvm/llvm-project/commit/50b33441487f9ccd447e17b1ecbd8799793993d4#
That commit replaces the line containing the following assert with actual error handling:
assert(!EC && "Failed to allocate resolver block");
After trying to reproduce the segfaults with LLVM 10, they completely disappeared.
So I have two questions:
- Would it be feasible to use LLVM7 for the x86_64 packages as well? Just like is done
- What would be required to build CentOS packages using LLVM8 or higher?
Jelte