I’m trying to debug an upstream issue with one of my dependencies (DuckDB). To summarise briefly, for the latest release everything works as expected on Linux, but the windows package fails to load a symbol from DuckDB_jll
. So I set out to replicate this issue to its simplest.
It seems the latest Windows build (1.1.2) cannot load any symbols from the underlying C++ library (see sessions shown below).
(only_duckdb_jll) pkg> st
Status `C:\path\to\dir\only_duckdb_jll\Project.toml`
[2cbbab25] DuckDB_jll v1.1.2+0
julia> using DuckDB_jll
julia> ccall((:duckdb_vector_size, libduckdb), UInt64, ())
ERROR: could not load symbol "duckdb_vector_size":
The specified procedure could not be found.
Stacktrace:
[1] top-level scope
@ .\REPL[2]:1
julia> ccall((:duckdb_config_count, libduckdb), Int32, ())
ERROR: could not load symbol "duckdb_config_count":
The specified procedure could not be found.
Stacktrace:
[1] top-level scope
@ .\REPL[4]:1
Whereas this works for an older version (1.0.0):
(only_duckdb_jll_old) pkg> st
Status `C:\path\to\dir\only_duckdb_jll_old\Project.toml`
⌃ [2cbbab25] DuckDB_jll v1.0.0+3
Info Packages marked with ⌃ have new versions available and may be upgradable.
julia> using DuckDB_jll
julia> ccall((:duckdb_vector_size, libduckdb), UInt64, ())
0x0000000000000800
julia> ccall((:duckdb_config_count, libduckdb), Int32, ())
78
For completeness, on Linux (version 1.1.2), I get:
(only-duckdb-jll) pkg> st
Status `path/to/dir/only-duckdb-jll/Project.toml`
[2cbbab25] DuckDB_jll v1.1.2+0
julia> using DuckDB_jll
julia> ccall((:duckdb_vector_size, libduckdb), UInt64, ())
0x0000000000000800
julia> ccall((:duckdb_config_count, libduckdb), Int32, ())
100
So I copied the library from libduckdb
to Linux, and looked at the symbols with nm
, they do exist. Now I don’t know how to proceed further. How do I find out why the symbols are not found in the newer version?
EDIT:
$ for lib in win-*/bin/libduckdb.dll; do \
echo Symbols in $lib; \
nm $lib | grep -e duckdb_config_count -e duckdb_vector_size; \
done
Symbols in win-1.0.0/bin/libduckdb.dll # version that works
0000000064d8c590 T duckdb_config_count
0000000064d8d1b0 T duckdb_vector_size
Symbols in win-1.1.2/bin/libduckdb.dll # version that fails
0000000064deb130 T duckdb_config_count
0000000064decc50 T duckdb_vector_size
00000000669504d0 r .rdata$.refptr.duckdb_config_count
0000000066951590 r .rdata$.refptr.duckdb_vector_size
00000000669504d0 R .refptr.duckdb_config_count
0000000066951590 R .refptr.duckdb_vector_size