pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: yangxiaoming2019@gmail.com
Subject: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
Date: Wed, 20 Dec 2023 10:51:52 +0000
Message-ID: <18254-e303b33b2317c861@postgresql.org> (raw )
The following bug has been logged on the website:
Bug reference: 18254
Logged by: Xiaoming Yang
Email address: yangxiaoming2019@gmail.com
PostgreSQL version: 16.1
Operating system: FreeBSD14
Description:
when I run the sql
```sql
explain analyze select .. from ...;
```
I got the error info
```text
SQL Error [XX000]: ERROR: could not load library
"/usr/local/lib/postgresql/llvmjit.so":
/usr/local/lib/postgresql/llvmjit.so: Undefined symbol
"_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE"
Where: parallel worker
ERROR: could not load library "/usr/local/lib/postgresql/llvmjit.so":
/usr/local/lib/postgresql/llvmjit.so: Undefined symbol
"_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE"
Where: parallel worker
ERROR: could not load library "/usr/local/lib/postgresql/llvmjit.so":
/usr/local/lib/postgresql/llvmjit.so: Undefined symbol
"_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE"
Where: parallel worker
``
I build postgresql on my FreeBSD system, the system & postgresql info:
```text
# build config
./configure --prefix=/usr/local --with-openssl --with-lz4
--with-wal-blocksize=64 --with-blocksize=32 --with-llvm
# uname -a
FreeBSD xxxx 14.0-RELEASE FreeBSD 14.0-RELEASE #0
releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
# pg_config
BINDIR = /usr/local/bin
DOCDIR = /usr/local/share/doc/postgresql
HTMLDIR = /usr/local/share/doc/postgresql
INCLUDEDIR = /usr/local/include
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/share/locale
MANDIR = /usr/local/share/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/usr/local' '--with-openssl' '--with-lz4'
'--with-wal-blocksize=64' '--with-blocksize=32' '--with-llvm'
'CFLAGS=-I/usr/local/include/python3.11/' 'LLVM_CONFIG=llvm-config16'
CC = gcc
CPPFLAGS = -I/usr/local/include -I/usr/local/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type
-Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation
-I/usr/local/include/python3.11/
CFLAGS_SL = -fPIC -DPIC
LDFLAGS = -L/usr/local/llvm16/lib -L/usr/local/lib -Wl,--as-needed
-Wl,-R'/usr/local/lib'
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -llz4 -lssl -lcrypto -lz -lreadline -lpthread
-lexecinfo -lm
VERSION = PostgreSQL 16.1
# llvm-config16 --version
16.0.6
# postgresql.conf
jit_provider = 'llvmjit'
```
Demangle the symbol
`_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt8optionalINS_5AlignEE` is
`llvm::MemoryBuffer::getFile(llvm::Twine const&, bool, bool, bool,
std::optional<llvm::Align>)`
And, I have another PostgreSQL on Rokey 9 Linux, it's work well.
The Linux version info:
```text
# uname -a
Linux xxx 5.14.0-362.8.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 8
17:36:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
# build config
./configure --with-openssl --with-zstd -with-lz4 --with-systemd
--with-python --with-llvm
# postgresql.conf
jit_provider = 'llvmjit'
# pg_config
BINDIR = /usr/local/bin
DOCDIR = /usr/local/share/doc/postgresql
HTMLDIR = /usr/local/share/doc/postgresql
INCLUDEDIR = /usr/local/include
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/share/locale
MANDIR = /usr/local/share/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/usr/local' '--with-openssl' '-with-lz4'
'--with-systemd' '--with-python' '--with-llvm'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type
-Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation
-O2
CFLAGS_SL = -fPIC
LDFLAGS = -L/usr/lib64 -Wl,--as-needed
-Wl,-rpath,'/usr/local/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -llz4 -lssl -lcrypto -lz -ledit -lm
VERSION = PostgreSQL 16.1
# llvm-config --version
16.0.6
# postgresql.conf
jit_provider = 'llvmjit'
```
Linux Version run out:
```text
-- some info
Planning Time: 1.596 ms
JIT:
Functions: 75
Options: Inlining true, Optimization true, Expressions true, Deforming
true
Timing: Generation 2.626 ms, Inlining 221.238 ms, Optimization 161.173
ms, Emission 132.760 ms, Total 517.797 ms
Execution Time: 1416.203 ms
```
view thread (3+ messages) latest in thread
Message-ID: <18254-e303b33b2317c861@postgresql.org>
Permalink: ../18254-e303b33b2317c861@postgresql.org/
Also on: postgresql.org/message-id/18254-e303b33b2317c861@postgresql.org
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, yangxiaoming2019@gmail.com
Subject: Re: BUG #18254: could not load library llvmjit.so,Undefined symbol "_ZN4llvm12MemoryBuffer7getFileERKNS_5TwineEbbbSt
In-Reply-To: <18254-e303b33b2317c861@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox