Re: Segfault in jit tuple deforming on arm64 due to LLVM issue
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-08-27T22:23:55Z
Lists: pgsql-hackers
Attachments
- v4-0001-Backport-of-LLVM-code-to-fix-ARM-relocation-bug.patch (application/octet-stream) patch v4-0001
On Wed, Aug 28, 2024 at 12:07 AM Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> wrote: > On Tue, Aug 27, 2024 at 12:01 PM Thomas Munro <thomas.munro@gmail.com> wrote: > > Thanks! And that's great news. Do you want to report this experience > > to the PR, in support of committing it? That'd make it seem easier to > > consider shipping a back-ported copy... > > Yes, I will do that. Thanks. Here's a slightly tidied up version: 1. I used namespace llvm::backport, instead of a different class name. That minimises the diff against their code. 2. I tested against LLVM 10-18, and found that 10 and 11 lack some needed symbols. So I just hid this code from them. Even though our stable branches support those and even older versions, I am not sure if it's worth trying to do something about that for EOL'd distros that no one has ever complained about. I am willing to try harder if someone thinks that's important... One little problem I am aware of is that if you make an empty .o, macOS's new linker issues a warning, but I think I could live with that. I guess I could put a dummy symbol in there... FWIW those old LLVM versions spit out tons of other warnings from the headers on newer compilers too, so *shrug*, don't use them? But then if this code lands in LLVM 19 we'll also be hiding it for 19+ too. Next, I think we should wait to see if the LLVM project commits that PR, this so that we can sync with their 19.x stable branch, instead of using code from a PR. Our next minor release is in November, so we have some time. If they don't commit it, we can consider it anyway: I mean, it's crashing all over the place in production, and we see that other projects are shipping this code already.
Commits
-
Monkey-patch LLVM code to fix ARM relocation bug.
- 9044fc1d45a0 18.0 landed
- 50c1453a308d 12.21 landed
- e88d824a4127 13.17 landed
- 0b022ddf3e30 14.14 landed
- 19bf81c06a37 15.9 landed
- ee67b73f5902 16.5 landed
- b7467ab71c19 17.1 landed