File descriptors leak

Hello Michael,

I have been using Virtual Here server on Raspberry Pi 3B (server version 4.2.0) with three clients - Windows 10, Ubuntu 20.04 and Mac OS 11 (client version 5.2.0) for some time and I have noticed that after some time - two weeks usually, the Virtual Here server process runs out available file descriptors (Linux limits 1024 for the process) and I receive the following message: Error 24 opening device (/dev/bus/usb/001/043) file descriptor, No file descriptors available

I think that there must be some sort of file descriptor leak. Could you please help me find the problem? I have pasted the list of all VH file descriptors to file here (output of lsof command): https://drive.google.com/file/d/1rRYuA7nRie1IXT5J9FlMUveBKeqziIHC/view?…

Thanks,
Marek

#2

Hi, thanks for the detailed, log. Could you update the server to the latest server version, i think that fixes the leak. The leak was related to avahi integration.

#3

Hi! I've got the similar problem vhusbdx86_64 v4.3.7 on Intel NUC with Ubuntu server 20.04
Mar 05 06:46:08 virtualhere-nuc vhusbdx86_64[3341]: Error 24 starting client authorization, No file descriptors available
Mar 05 06:46:08 virtualhere-nuc vhusbdx86_64[3341]: Error binding device 111 [0a89:0025] to connection 227, BIND_ERROR
Mar 05 06:46:12 virtualhere-nuc vhusbdx86_64[3341]: Error 24 starting client authorization, No file descriptors available
Mar 05 06:46:12 virtualhere-nuc vhusbdx86_64[3341]: Error binding device 1132 [0a89:0025] to connection 227, BIND_ERROR

#4

Can you post the output of lsof on the server when it happens again? Maybe in pastebin

#6

Thanks, can you stop the virtualhere server then edit the server config.ini file and add the line

UseAVAHIServiceFile=1

Then save and start the process again. See if that resolves it

#7

Thank you. I'll try it and return with feedback.

#8

Michael, it looks like this doesn't helps. It's been 36 hours since I've restarted virtualhere server and the number of its open file descriptors are already reached 50k and continues to grow.

#9

Can you post here your server config.ini file

#11

What does auth.sh do? I wonder if that could that be leaking instead (it would be a child of the vhusbdx86_64 process). VirtualHere only uses one netlink socket and that doesnt leak so im wondering if it might be some program you are calling in auth.sh.

#13

Do you have this directory /etc/avahi/services on your server, with files in it?

#14

No. It seems like no avahi in my system at all.

#15

Ah ok, so thats it. Actually if you look carefully in the log it will probably say "Linux AVAHI daemon not installed, using built-in mdns server instead"

So can you install avahi so that virtualhere server can use it.

sudo apt install avahi-daemon

Then reboot your server or stop/start the virtualhere server service

(The fallback is to use the mdns internal server but it has a leak in it and thats what you are encountering)

#16

Thank you. I'll try it and continue to monitor and return with any updates.

#17

Thank you again! Your advice helped me to solve this problem.

#18

OK thats great, im glad its all fixed now