Bug 250046 - audio/virtual_oss ld-elf.so.1: Shared object "libfftw3.so.3" not found
Summary: audio/virtual_oss ld-elf.so.1: Shared object "libfftw3.so.3" not found
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-02 09:46 UTC by Graham Perrin
Modified: 2020-10-09 05:25 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (hselasky)


Attachments
A photograph of the error from a few days ago, when my rc.conf was slightly different (218.01 KB, image/jpeg)
2020-10-02 09:46 UTC, Graham Perrin
no flags Details
kdump output (28.86 KB, text/plain)
2020-10-04 13:01 UTC, Graham Perrin
no flags Details
Screenshot: .pid file present but the service is not running (341.08 KB, image/png)
2020-10-05 06:35 UTC, Graham Perrin
no flags Details
Konsole output (11.71 KB, text/plain)
2020-10-06 19:31 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin 2020-10-02 09:46:05 UTC
Created attachment 218465 [details]
A photograph of the error from a few days ago, when my rc.conf was slightly different

With rc.conf as outlined at <https://pastebin.com/s9h1fXPX>:

- a shared object is not found at init time
- I find it necessary to start the service manually (see below)

---

root@momh167-gjp4-8570p:~ # date ; uname -v
Fri Oct  2 10:41:39 BST 2020
FreeBSD 13.0-CURRENT #66 r366136: Fri Sep 25 18:46:17 BST 2020     root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
root@momh167-gjp4-8570p:~ # service virtual_oss start
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 1 -> 0
 done
root@momh167-gjp4-8570p:~ #
Comment 1 Hans Petter Selasky freebsd_committer 2020-10-02 13:25:26 UTC
What does:
pkg info | grep fftw


Output?
Comment 2 Graham Perrin 2020-10-03 10:18:41 UTC
root@momh167-gjp4-8570p:~ # pkg info | grep fftw
fftw3-3.3.8_6                  Fast C routines to compute the Discrete Fourier Transform
fftw3-float-3.3.8_6            Fast Discrete Fourier Transform (Single Precision C Routines)
root@momh167-gjp4-8570p:~ # pkg query '%o %v %R' fftw3 fftw3-float
math/fftw3 3.3.8_6 FreeBSD
math/fftw3-float 3.3.8_6 FreeBSD
root@momh167-gjp4-8570p:~ #
Comment 3 Hans Petter Selasky freebsd_committer 2020-10-03 10:21:55 UTC
And:

ldd `which virtual_oss`

--HPS
Comment 4 Graham Perrin 2020-10-03 11:37:20 UTC
root@momh167-gjp4-8570p:~ # ldd `which virtual_oss`
/usr/local/sbin/virtual_oss:
        libbluetooth.so.4 => /usr/lib/libbluetooth.so.4 (0x80025e000)
        libsdp.so.4 => /usr/lib/libsdp.so.4 (0x800266000)
        libfftw3.so.3 => /usr/local/lib/libfftw3.so.3 (0x80026e000)
        libcuse.so.1 => /usr/lib/libcuse.so.1 (0x8003f8000)
        libthr.so.3 => /lib/libthr.so.3 (0x8003ff000)
        libm.so.5 => /lib/libm.so.5 (0x80042c000)
        libsamplerate.so.0 => /usr/local/lib/libsamplerate.so.0 (0x80045f000)
        libc.so.7 => /lib/libc.so.7 (0x8005cc000)
root@momh167-gjp4-8570p:~ #
Comment 5 Hans Petter Selasky freebsd_committer 2020-10-03 12:35:39 UTC
And:

ls -l /usr/local/lib/libfftw3.so*

Likely you need to re-install virtual_oss either from source or pkg and that will resolve the problem.

--HPS
Comment 6 Graham Perrin 2020-10-03 18:30:57 UTC
root@momh167-gjp4-8570p:~ # ls -l /usr/local/lib/libfftw3.so*
lrwxr-xr-x  1 root  wheel       17 Apr 21 02:40 /usr/local/lib/libfftw3.so -> libfftw3.so.3.5.8
lrwxr-xr-x  1 root  wheel       17 Apr 21 02:40 /usr/local/lib/libfftw3.so.3 -> libfftw3.so.3.5.8
-rwxr-xr-x  1 root  wheel  1602432 Apr 21 02:40 /usr/local/lib/libfftw3.so.3.5.8
root@momh167-gjp4-8570p:~ #
Comment 7 Graham Perrin 2020-10-03 18:37:50 UTC
(In reply to Hans Petter Selasky from comment #5)

> … Likely you need to re-install virtual_oss … 

Below, the cached package size mismatch was remarkable. 

Reinstalled, I'll restart the OS …

--

root@momh167-gjp4-8570p:~ # service virtual_oss stop
Stopping Virtual OSS config dsp ... done
root@momh167-gjp4-8570p:~ # pkg remove virtual_oss
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 2 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        virtual_oss: 1.2.6_1
        virtual_oss_ctl: 1.2.1

Number of packages to be removed: 2

Proceed with deinstalling packages? [y/N]: y
[1/2] Deinstalling virtual_oss_ctl-1.2.1...
[1/2] Deleting files for virtual_oss_ctl-1.2.1: 100%
[2/2] Deinstalling virtual_oss-1.2.6_1...
[2/2] Deleting files for virtual_oss-1.2.6_1: 100%
root@momh167-gjp4-8570p:~ # pkg install virtual_oss virtual_oss_ctl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        virtual_oss: 1.2.6_1 [FreeBSD]
        virtual_oss_ctl: 1.2.1 [FreeBSD]

Number of packages to be installed: 2

87 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching virtual_oss-1.2.6_1.txz: 100%   51 KiB  52.6kB/s    00:01    
pkg: cached package virtual_oss-1.2.6_1: size mismatch, fetching from remote
[2/2] Fetching virtual_oss-1.2.6_1.txz: 100%   51 KiB  52.6kB/s    00:01    
pkg: cached package virtual_oss-1.2.6_1: size mismatch, cannot continue
Consider running 'pkg update -f'
root@momh167-gjp4-8570p:~ # pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB 937.6kB/s    00:07    
Processing entries: 100%
Fetching provides database: 100%   14 MiB 805.2kB/s    00:18    
Extracting database....success
FreeBSD repository update completed. 31678 packages processed.
Updating poudriere repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.txz: 100%    2 KiB   1.6kB/s    00:01    
Processing entries: 100%
The provides database is up-to-date.
poudriere repository update completed. 5 packages processed.
All repositories are up to date.
root@momh167-gjp4-8570p:~ # pkg install virtual_oss virtual_oss_ctl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        virtual_oss: 1.2.6_1 [FreeBSD]
        virtual_oss_ctl: 1.2.1 [FreeBSD]

Number of packages to be installed: 2

87 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching virtual_oss-1.2.6_1.txz: 100%   51 KiB  52.6kB/s    00:01    
[2/2] Fetching virtual_oss_ctl-1.2.1.txz: 100%   36 KiB  36.4kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/2] Installing virtual_oss-1.2.6_1...
[1/2] Extracting virtual_oss-1.2.6_1: 100%
[2/2] Installing virtual_oss_ctl-1.2.1...
[2/2] Extracting virtual_oss_ctl-1.2.1: 100%
root@momh167-gjp4-8570p:~ #
Comment 8 Hans Petter Selasky freebsd_committer 2020-10-03 18:43:33 UTC
When does this happen?

When you run using the rc.d or when manually?

I think /usr/local/lib is not added to the library search patch when virtual_oss is started.

This can be worked around by adding the missing libraries as:

env LD_PRELOAD=/usr/local/lib/xxx virtual_oss ...

--HPS
Comment 9 Graham Perrin 2020-10-03 19:02:46 UTC
(In reply to Hans Petter Selasky from comment #8)

rc.d
Comment 10 commit-hook freebsd_committer 2020-10-03 19:23:56 UTC
A commit references this bug:

Author: hselasky
Date: Sat Oct  3 19:23:23 UTC 2020
New revision: 551339
URL: https://svnweb.freebsd.org/changeset/ports/551339

Log:
  Add missing LD_PRELOAD= environment variable to the virtual_oss rc.d .

  PR:		250046
  Approved by:	pi (implicit)

Changes:
  head/audio/virtual_oss/Makefile
  head/audio/virtual_oss/files/virtual_oss.in
Comment 11 Hans Petter Selasky freebsd_committer 2020-10-03 19:25:59 UTC
Try the patch I submitted.

--HPS
Comment 12 Graham Perrin 2020-10-04 08:03:36 UTC
Thanks, now I get: 

root@momh167-gjp4-8570p:~ # service virtual_oss start
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 0 -> 0
virtual_oss: Could not create CUSE DSP device
 done
root@momh167-gjp4-8570p:~ # service virtual_oss status
virtual_oss is not running.
root@momh167-gjp4-8570p:~ #
Comment 13 Hans Petter Selasky freebsd_committer 2020-10-04 09:44:11 UTC
Can you show me you virtual_oss configuration in rc.conf?

Also:

ls /dev/*dsp*

--HPS
Comment 14 Hans Petter Selasky freebsd_committer 2020-10-04 09:44:37 UTC
And also check that:

cuse_load=YES

is in your /boot/loader.conf

--HPS
Comment 15 Graham Perrin 2020-10-04 10:50:17 UTC
root@momh167-gjp4-8570p:~ # ls -l /dev/*dsp*
crw-rw-rw-  1 root  wheel  0x220 Oct  4 10:28 /dev/dsp0.0
crw-rw-rw-  1 root  wheel  0x21a Oct  4 10:16 /dev/dsp0.1
crw-rw-rw-  1 root  wheel  0x21d Oct  4 11:20 /dev/dsp1.0
crw-rw-rw-  1 root  wheel  0x21c Oct  4 10:35 /dev/dsp1.1
crw-rw-rw-  1 root  wheel  0x21f Oct  4 10:28 /dev/dsp2.0
crw-rw-rw-  1 root  wheel  0x21e Oct  4 10:16 /dev/dsp2.1
root@momh167-gjp4-8570p:~ # grep cuse /boot/loader.conf
cuse_load="YES"
root@momh167-gjp4-8570p:~ # grep -v \# /etc/rc.conf
rc_debug="NO"
rc_info="YES"
rc_startmsgs="NO"
always_force_depends="NO"
kldxref_enable="NO"
kldxref_clobber="NO"
dmesg_enable="YES"
clear_tmp_enable="YES"
keymap="uk.kbd"
hostname="momh167-gjp4-8570p"
linux_enable="YES"
zfs_enable="YES"
kld_list="fusefs"
devfs_system_ruleset="system"
dbus_enable="YES"
vboxnet_enable="YES"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
cupsd_enable="YES"
powerdxx_enable="YES"

kld_list="/boot/modules/drm.ko"

hald_enable="YES"
sddm_enable="YES"

webcamd_enable="YES"
webcamd_flags="-H"

virtual_oss_enable="YES"
sndiod_enable="YES"

dumpdev="/dev/ada0p3"
dumpdir="/var/crash"
savecore_enable="YES"

ifconfig_ue0="DHCP"

create_args_wlan0="country GB regdomain etsi"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

ifconfig_em0="DHCP"





root@momh167-gjp4-8570p:~ # 


----

From /usr/local/etc/rc.d/virtual_oss

name=virtual_oss
desc="Virtual OSS device manager"
rcvar=${name}_enable
start_precmd="${name}_precmd"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
# required_modules="cuse"
virtual_oss_default_args="\
  -T /dev/sndstat \
  -S \
  -i 8 \
  -C 2 -c 2 \
  -r 48000 \
  -b 24 \
  -s 8.0ms \
  -f /dev/dsp1 \
  -c 2 \
  -d dsp \
  -t vdsp.ctl"
configs=
Comment 16 Hans Petter Selasky freebsd_committer 2020-10-04 11:20:03 UTC
And you also have permissions for /dev/cuse ?

ls -l /dev/cuse

--HPS
Comment 17 Hans Petter Selasky freebsd_committer 2020-10-04 11:22:44 UTC
Could you invoke the software manually:

ktrace virtual_oss \
  -T /dev/sndstat \
  -S \
  -i 8 \
  -C 2 -c 2 \
  -r 48000 \
  -b 24 \
  -s 8.0ms \
  -f /dev/dsp1 \
  -c 2 \
  -d dsp \
  -t vdsp.ctl

Then run:

kdump

Also check:

ps auxw | grep virtual_oss

For multiple instances.

--HPS
Comment 18 Graham Perrin 2020-10-04 12:55:42 UTC
root@momh167-gjp4-8570p:~ # uptime ; ls -l /dev/cuse
 1:53PM  up 11 mins, 5 users, load averages: 0.38, 0.80, 0.47
crw-------  1 root  operator  0x4 Oct  4 13:42 /dev/cuse
root@momh167-gjp4-8570p:~ # ps auxw | grep virtual_oss
root          115   1.4  0.0   17908    5044  -  S<s  13:43    0:04.27 /usr/local/sbin/virtual_oss -B -D /var/run/virtual_oss/dsp.pid -T /dev/sndstat -S -i 8 -C 2 -c 2 -r 48000 -b 24 -s 8.0ms -f /dev/dsp1 -c 2 
root         3989   0.0  0.0   13256    2756  3  S+   13:54    0:00.00 grep virtual_oss
root@momh167-gjp4-8570p:~ # service virtual_oss status
virtual_oss is not running.
root@momh167-gjp4-8570p:~ # service virtual_oss start
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 0 -> 0
virtual_oss: Could not create CUSE DSP device
 done
root@momh167-gjp4-8570p:~ # service virtual_oss status
virtual_oss is not running.
root@momh167-gjp4-8570p:~ # 

--

kdump to follow …
Comment 19 Graham Perrin 2020-10-04 13:01:04 UTC
Created attachment 218512 [details]
kdump output
Comment 20 Hans Petter Selasky freebsd_committer 2020-10-04 13:23:23 UTC
What happens if you do:

kilall virtual_oss

first?

--HPS
Comment 21 Graham Perrin 2020-10-04 13:29:34 UTC
root@momh167-gjp4-8570p:~ # grep autoconf /var/log/messages
Oct  4 14:19:09 momh167-gjp4-8570p pkg[5967]: autoconf upgraded: 2.13.000227_7 -> 2.69_3 
root@momh167-gjp4-8570p:~ # killall virtual_oss
root@momh167-gjp4-8570p:~ # service virtual_oss start
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 0 -> 0
 done
root@momh167-gjp4-8570p:~ # service virtual_oss status
virtual_oss is not running.
root@momh167-gjp4-8570p:~ # service virtual_oss start
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 0 -> 0
virtual_oss: Could not create CUSE DSP device
 done
root@momh167-gjp4-8570p:~ # service virtual_oss status
virtual_oss is not running.
root@momh167-gjp4-8570p:~ # 

--

Side note: today's upgrade of autoconf took me by surprise.
Comment 22 Hans Petter Selasky freebsd_committer 2020-10-04 14:25:40 UTC
I'm pretty sure virtual_oss is running.

How does your /var/run look? Any write protections here?

Does "/var/run/virtual_oss/dsp.pid" exist?

--HPS
Comment 23 Graham Perrin 2020-10-05 06:35:18 UTC
Created attachment 218530 [details]
Screenshot: .pid file present but the service is not running

The .pid file is present but e.g. virtual_oss_ctl behaves as if the service is not running; and its status is 'not running'.

I'll upgrade to r366424 (built, not yet installed).
Comment 24 Graham Perrin 2020-10-05 07:41:30 UTC
The same with r366424 as with r366136. 

In both cases, forcing a downgrade allows the service to run effectively: 

pkg upgrade -f -r FreeBSD virtual_oss

– still at 1.2.6_1 in the FreeBSD repository at the time of writing. 

Then, remake changes to two lines: 

nano /usr/local/etc/rc.d/virtual_oss

– restart the service, things become audible and virtual_oss_ctl presents its connection diagram and so on.
Comment 25 Hans Petter Selasky freebsd_committer 2020-10-05 12:02:01 UTC
Can you try to install virtual_oss from sources /usr/ports ?
Comment 26 Graham Perrin 2020-10-06 19:31:56 UTC
Created attachment 218573 [details]
Konsole output

Not captured in this .txt file: editions to 
/usr/local/etc/rc.d/virtual_oss
(immediately after the installation of 1.2.6_2, the same edition immediately after the downgrade to 1.2.6_1).

--

(In reply to Hans Petter Selasky from comment #25)

As far as I can tell: the effect of installation from /usr/ports is no different from the effect of installation from my poudriere repository. 

The .pid file is present but the status of the service is 'not running'. After the downgrade: running.
Comment 27 Hans Petter Selasky freebsd_committer 2020-10-06 20:38:34 UTC
If you look at the version history of virtual_oss in ports, there hasn't been very many changes, so I find this very strange.

Can you extract the two pkg's and do a full diff?

--HPS
Comment 28 commit-hook freebsd_committer 2020-10-06 20:58:13 UTC
A commit references this bug:

Author: hselasky
Date: Tue Oct  6 20:58:10 UTC 2020
New revision: 551596
URL: https://svnweb.freebsd.org/changeset/ports/551596

Log:
  Fix path for virtual_oss when checking pidfile in rc.d file.

  PR:		250046
  Approved by:	pi (implicit)

Changes:
  head/audio/virtual_oss/Makefile
  head/audio/virtual_oss/files/virtual_oss.in
Comment 29 Hans Petter Selasky freebsd_committer 2020-10-06 20:58:54 UTC
OK,

I think I found it. Sorry for taking so long.

Try again with _3 .

--HPS
Comment 30 Graham Perrin 2020-10-07 06:40:52 UTC
root@momh167-gjp4-8570p:~ # service virtual_oss start
/usr/local/etc/rc.d/virtual_oss: DEBUG: checkyesno: virtual_oss_enable is set to YES.
/usr/local/etc/rc.d/virtual_oss: DEBUG: run_rc_command: start_precmd: virtual_oss_precmd 
/usr/local/etc/rc.d/virtual_oss: DEBUG: run_rc_command: doit: virtual_oss_start 
Starting Virtual OSS config dsp ...hw.snd.basename_clone: 1 -> 0
 done
root@momh167-gjp4-8570p:~ # service virtual_oss status
/usr/local/etc/rc.d/virtual_oss: DEBUG: checkyesno: virtual_oss_enable is set to YES.
virtual_oss is not running.
root@momh167-gjp4-8570p:~ # pkg info -x virtual_oss
virtual_oss-1.2.6_3
virtual_oss_ctl-1.2.1
root@momh167-gjp4-8570p:~ # pkg upgrade -f -r FreeBSD virtual_oss
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
        virtual_oss: 1.2.6_3 -> 1.2.6_1 [FreeBSD]

Number of packages to be downgraded: 1

51 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching virtual_oss-1.2.6_1.txz: 100%   51 KiB  52.7kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Downgrading virtual_oss from 1.2.6_3 to 1.2.6_1...
[1/1] Extracting virtual_oss-1.2.6_1: 100%
root@momh167-gjp4-8570p:~ # service virtual_oss status
/usr/local/etc/rc.d/virtual_oss: DEBUG: checkyesno: virtual_oss_enable is set to YES.
virtual_oss is running as pid 29521.
root@momh167-gjp4-8570p:~ # 


--

Sorry!
Comment 31 Hans Petter Selasky freebsd_committer 2020-10-07 07:11:27 UTC
Try again with _4 .

--HPS
Comment 32 commit-hook freebsd_committer 2020-10-07 07:11:34 UTC
A commit references this bug:

Author: hselasky
Date: Wed Oct  7 07:10:57 UTC 2020
New revision: 551619
URL: https://svnweb.freebsd.org/changeset/ports/551619

Log:
  Fix rc.d status command for virtual_oss.

  PR:		250046
  Approved by:	pi (implicit)

Changes:
  head/audio/virtual_oss/Makefile
  head/audio/virtual_oss/files/virtual_oss.in
Comment 33 Graham Perrin 2020-10-08 16:58:49 UTC
Success! 

Incidentally (sorry if I'm overlooking something obvious in a manual page), is there a way for me to avoid the need to manually edit /usr/local/etc/rc.d/virtual_oss after each update to the port?

----

root@momh167-gjp4-8570p:~ # date ; uname -v ; uptime
Thu Oct  8 17:54:35 BST 2020
FreeBSD 13.0-CURRENT #67 r366424: Sun Oct  4 19:54:32 BST 2020     root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
 5:54PM  up 8 mins, 5 users, load averages: 3.15, 1.56, 0.69
root@momh167-gjp4-8570p:~ # service virtual_oss status
/usr/local/etc/rc.d/virtual_oss: DEBUG: checkyesno: virtual_oss_enable is set to YES.
/usr/local/etc/rc.d/virtual_oss: DEBUG: run_rc_command: doit: virtual_oss_status 
virtual_oss is running as pid 6411 299.
root@momh167-gjp4-8570p:~ # pkg query '%o %v %R' virtual_oss
audio/virtual_oss 1.2.6_4 poudriere
root@momh167-gjp4-8570p:~ # grep -A 11 'virtual_oss_default_args=' /usr/local/etc/rc.d/virtual_oss
virtual_oss_default_args="\
  -T /dev/sndstat \
  -S \
  -i 8 \
  -C 2 -c 2 \
  -r 48000 \
  -b 24 \
  -s 8.0ms \
  -f /dev/dsp1 \
  -c 2 \
  -d dsp \
  -t vdsp.ctl"
root@momh167-gjp4-8570p:~ #
Comment 34 Hans Petter Selasky freebsd_committer 2020-10-08 22:27:14 UTC
Just put something like this in /etc/rc.conf, and it will work:

virtual_oss_dsp="\
  -T /dev/sndstat \
  -S \
  -i 8 \
  -C 2 -c 2 \
  -r 48000 \
  -b 24 \
  -s 8.0ms \
  -f /dev/dsp3 \
  -c 2 \
  -d vdsp \
  -t dsp.ctl"
Comment 35 Graham Perrin 2020-10-09 05:25:46 UTC
Thank you 👍