Re: broken JIT support on Fedora 40
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Pavel Stehule <pavel.stehule@gmail.com>,
Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Dmitry Dolgov <9erthalion6@gmail.com>
Date: 2024-03-15T00:54:38Z
Lists: pgsql-hackers
For me it seems that the LLVMRunPasses() call, new in
commit 76200e5ee469e4a9db5f9514b9d0c6a31b496bff
Author: Thomas Munro <tmunro@postgresql.org>
Date: Wed Oct 18 22:15:54 2023 +1300
jit: Changes for LLVM 17.
is reaching code that segfaults inside libLLVM, specifically in
llvm::InlineFunction(llvm::CallBase&, llvm::InlineFunctionInfo&, bool,
llvm::AAResults*, bool, llvm::Function*). First obvious question
would be: is that NULL argument still acceptable? Perhaps it wants
our LLVMTargetMachineRef there:
err = LLVMRunPasses(module, passes, NULL, options);
But then when we see what is does with that argument, it arrives at a
place that apparently accepts nullptr.
https://github.com/llvm/llvm-project/blob/6b2bab2839c7a379556a10287034bd55906d7094/llvm/lib/Passes/PassBuilderBindings.cpp#L56
https://github.com/llvm/llvm-project/blob/6b2bab2839c7a379556a10287034bd55906d7094/llvm/include/llvm/Passes/PassBuilder.h#L124
Hrmph. Might need an assertion build to learn more. I'll try to look
again next week or so.
Commits
-
Run LLVM verify pass on IR in assert builds.
- 8583b1f99340 18.0 landed
-
Fix illegal attribute propagation in LLVM JIT.
- 01b55203ace0 12.19 landed
- 4f90750b5326 13.15 landed
- 7fe32eaa4a87 14.12 landed
- 74992929a79e 15.7 landed
- 53c8d6c9f157 17.0 landed
- bf1cfe77ed49 16.3 landed
-
Track LLVM 18 changes.
- d282e88e5052 17.0 cited
-
jit: Changes for LLVM 17.
- 76200e5ee469 17.0 cited