Hi,

I noticed a really bizarre issue with the linking system and thought to ask if anyone has any ideas.

Setup:

gcc - 11.1.0 ldd - 2.33 linux - 5.15.6-arch2-1 

pipewire-jack-dropin has been installed to prioritize Pipewire's JACK libraries during loading, thus JACK clients will automatically connect to Pipewire.

It does so by dumping a .conf file with Pipewire's path in /etc/ld.so.conf.d.

This was working fine since i switched to Pipewire.

However, recently, some applications have started to throw errors and complaining about a missing server. After a bit of digging, it turns out that they load JACK2 libjack.so and thus they can't connect to Pipewire.

mpv v0.34

~ ldd /usr/bin/mpv | grep jack libjack.so.0 => /usr/lib/libjack.so.0 (0x00007f0c43fb3000) 

If i downgrade the version, it works fine:

mpv v0.33

~ ldd /usr/bin/mpv | grep jack libjack.so.0 => /usr/lib/pipewire-0.3/jack/libjack.so.0 (0x00007ff1bbea8000) 

It seems that setting LD_LIBRARY_PATH manually, still works:

mpv v0.34

LD_LIBRARY_PATH=/usr/lib/pipewire-0.3/jack ldd /usr/bin/mpv | grep jack libjack.so.0 => /usr/lib/pipewire-0.3/jack/libjack.so.0 (0x00007f6172da9000) 

I've also manually removed /etc/ld.so.cache, rebuild it, rebooted, verified that the pipewire path is in the file and it's still loading /usr/lib/libjack.so.

Is there a compile flag that can ignore ld.so.conf? Or some runtime feature that can prevent it from working correctly?

EDIT:

Attached below is the LD_DEBUG output for the different test:

mpv v0.34

 file=libjack.so.0 [0]; needed by /usr/bin/mpv [0] find library=libjack.so.0 [0]; searching search path=/usr/lib (system search path) trying file=/usr/lib/libjack.so.0 

mpv v0.34 (with LD_LIBRARY_PATH set)

 file=libjack.so.0 [0]; needed by /usr/bin/mpv [0] find library=libjack.so.0 [0]; searching search path=/usr/lib/pipewire-0.3/jack (LD_LIBRARY_PATH) trying file=/usr/lib/pipewire-0.3/jack/libjack.so.0 

mpv v0.33

 file=libjack.so.0 [0]; needed by /usr/bin/mpv [0] find library=libjack.so.0 [0]; searching search cache=/etc/ld.so.cache trying file=/usr/lib/pipewire-0.3/jack/libjack.so.0 

EDIT:

The following is strace of the two versions:

mpv v0.34

execve("/usr/bin/mpv", ["mpv", "/tmp/audio.wav"...], 0x7fff756de778 /* XX vars */) = 0 brk(NULL) = 0x559d01f68000 arch_prctl(0x3001 /* ARCH_??? */, 0x7fff56fe2250) = -1 EINVAL (Invalid argument) access("/etc/ld.so.preload", R_OK) = 0 openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=32, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 32, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fd602473000 close(3) = 0 munmap(0x7fd602473000, 32) = 0 openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/tls/x86_64/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/tls/x86_64/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/tls/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/tls/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/tls/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/tls/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/tls/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/tls", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/x86_64/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/x86_64/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/x86_64/libavutil.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) newfstatat(AT_FDCWD, "/usr/lib/x86_64", 0x7fff56fe1490, 0) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/libavutil.so.56", O_RDONLY|O_CLOEXEC) = 3 

mpv v0.33

execve("/usr/bin/mpv", ["mpv", "/tmp/audio.wav"...], 0x7ffe22e3fc68 /* XX vars */) = 0 brk(NULL) = 0x565061abb000 arch_prctl(0x3001 /* ARCH_??? */, 0x7fff8eb8ba50) = -1 EINVAL (Invalid argument) access("/etc/ld.so.preload", R_OK) = 0 openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=32, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 32, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f7458e7c000 close(3) = 0 munmap(0x7f7458e7c000, 32) = 0 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=228512, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 228512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7458e45000 close(3) = 0 openat(AT_FDCWD, "/usr/lib/libasound.so.2", O_RDONLY|O_CLOEXEC) = 3 

The newer version (v0.34) seems to load /etc/ld.so.cache eventually, but after quite a few of the libraries have been loaded. While with v0.33, the second file that's loaded is /etc/ld.so.cache.

submitted by /u/A78BECAFB33DD95
[link] [comments]