Skip to content

[RISC-V][ORCJIT] PostgreSql JIT fails with "error during JITing: In graph pg-jitted-objectbuffer, section .text: relocation target "CurrentMemoryContext" at address 0x555555e84b00 is out of range of R_RISCV_PCREL_HI20 fixup at 0x7f221c4bb1e4 (evalexpr_0_0, 0x7f221c4bb000 + 0x1e4)" #106203

@andreas-schwab

Description

@andreas-schwab

When postgresql is configured with --with-llvm the regression testsuite causes a lot of crashed that all look like this:

#0 std::_Deque_iterator<llvm::SectionEntry, llvm::SectionEntry&, llvm::SectionEntry*>::_M_set_node (__new_node=0x19db8a08, this=)
at /usr/lib64/gcc/riscv64-suse-linux/13/../../../../include/c++/13/bits/stl_deque.h:266
#1 std::_Deque_iterator<llvm::SectionEntry, llvm::SectionEntry&, llvm::SectionEntry*>::operator+= (__n=, this=)
at /usr/lib64/gcc/riscv64-suse-linux/13/../../../../include/c++/13/bits/stl_deque.h:241
#2 std::operator+ (__x=..., __n=)
at /usr/lib64/gcc/riscv64-suse-linux/13/../../../../include/c++/13/bits/stl_deque.h:400
#3 std::_Deque_iterator<llvm::SectionEntry, llvm::SectionEntry&, llvm::SectionEntry*>::operator[] (this=, __n=)
at /usr/lib64/gcc/riscv64-suse-linux/13/../../../../include/c++/13/bits/stl_deque.h:255
#4 std::deque<llvm::SectionEntry, std::allocatorllvm::SectionEntry >::operator[] (this=, __n=)
at /usr/lib64/gcc/riscv64-suse-linux/13/../../../../include/c++/13/bits/stl_deque.h:1386
#5 llvm::RuntimeDyldELF::computePlaceholderAddress (this=,
SectionID=, Offset=848)
at /usr/src/debug/llvm-18.1.8.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:1086
#6 0x0000003f83fc33ca in llvm::RuntimeDyldImpl::resolveRelocationList (
this=0xb117b80, Relocs=..., Value=0)
at /usr/src/debug/llvm-18.1.8.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1106
#7 llvm::RuntimeDyldImpl::applyExternalSymbolRelocations (this=0xb117b80,
ExternalSymbolMap=<error reading variable: Cannot access memory at address 0x18>)
at /usr/src/debug/llvm-18.1.8.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp:1119
#8 0x000000000a287310 in ?? ()

IIUC RuntimeDyld is part of MC JIT and should not be used by ORC JIT.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions