Created attachment 219740 [details]
I've ran into reproducible postgresql13 crash with LLVM enabled.
Can be reproduced with the following query:
SET jit_above_cost = 0;
SET jit_inline_above_cost = 0;
SET jit_optimize_above_cost = 0;
Problem summary: thread local storage access from code inlined by LLVM JIT instantly crashes (llvm11 also reports an error about unsupported relocation). On FreeBSD TLS accesses are quite common as functions like isspace() (used in boolin and input functions for many other commonly used postgresql types) involve caching of locale specific data in TLS.
Upstream bug including details, investigation and a workaround:
For now, I suggest to apply the attached patch which disables inlining of functions which access TLS. Alternative would be to disable LLVM completely and mark it BROKEN, but IMO that'd be an overkill.
Ping. Let me remind that postgresql13 with LLVM is currently broken.
A commit references this bug:
Date: Tue Dec 15 20:50:11 UTC 2020
New revision: 558181
Patch to mitigate a crash with LLVM JIT
PR: 251192 (Submitted by Dmitry Marakasov)