Can't load sqlite library in chroot

Started by vetelko, January 20, 2025, 11:53:00 AM

Previous topic - Next topic

vetelko

Hi guys,

I can load libsqlite3 in normal environment but NOT while in chroot. It is interesting that other libraries like libc can be loaded as you can see in the following example:

gringo: ~ $: newlisp
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi, options: newlisp -h

> (import "/var/www/usr/lib/libsqlite3.so.8.6")
true

Now chroot, the same library file with different path of course:

gringo: ~ $: doas chroot -u www -g www /var/www /usr/bin/newlisp
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi, options: newlisp -h

> (import "/usr/lib/libsqlite3.so.8.6")

ERR: problem loading library in function import : "Cannot load specified object"

> (import "/usr/lib/libc.so.100.3" "printf")
printf@D5CDE4B7A40
>
gringo: ~ $:

ANY idea?
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi

rrq

At a guess libm is missing in the chroot. Check library dependencies with ldd.

vetelko

All required libs are available :( I can (import ...) any of them except libsqlite3 while newlisp runs in chroot

gringo: ~ $: ls /var/www/usr/lib/
total 31968
drwxr-xr-x  2 root  daemon   512B Jan 20 20:32 ./
drwxr-xr-x  7 root  daemon   512B Apr 10  2023 ../
-r--r--r--  1 root  daemon   3.6M Jan 15 10:24 libc.so.100.3
-r--r--r--  1 root  daemon   1.8M Jan 15 10:31 libcurses.so.15.0
-r--r--r--  1 root  daemon  43.1K Jan 15 10:24 libffi.so.2.1
-r--r--r--  1 root  daemon   584K Jan 15 10:22 libm.so.10.1
-r--r--r--  1 root  daemon   597K Jan 15 10:22 libreadline.so.5.0
-r--r--r--  1 root  daemon   7.0M Jan 20 18:51 libsqlite3.so.8.6
newLISP v.10.7.6 64-bit on BSD IPv4/6 UTF-8 libffi