Too many open files of type "can't identify protocol"

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Daedroth
Newbie
Newbie
Posts: 4
Joined: Fri Jun 29, 2018 7:24 pm

Too many open files of type "can't identify protocol"

Post by Daedroth »

Good evening!

I use a conole application which I wrote, under Debian with wine-1.6.2 (32-bit).
At one particular server I hit the "Too many open files in system" error enough often and sometimes it causes the crash of important applications. I've found that the reason is too high amount of files like these (lsof output)
wineserve 11584 user1 104u sock 0,6 0t0 1562214199 can't identify protocol
wineserve 11584 user1 105u sock 0,6 0t0 1562214203 can't identify protocol
wineserve 11584 user1 106u sock 0,6 0t0 1562214207 can't identify protocol
wineserve 11584 user1 107u sock 0,6 0t0 1562214211 can't identify protocol
wineserve 11584 user1 108u sock 0,6 0t0 1562214215 can't identify protocol
I would say when the app works number of files is > 11000, when not it's about 5000. Unfortunately, I can't increase the number of files because of strict limits of the VPS hosting company.

The app has 3 threads (2 created from the main thread). Main thread does not work with sockets, the working procedure of created threads is looks like:

Code: Select all

socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
bind();
while not shutdown do
begin
	RecvFrom();
	//process the data
	SendTo()
end;
Closesocket();
Technically the app creates two sockets which exist from it's start until shutdown. Sometimes app requests some data from remote web server using HTTP, there is also closesocket() present. The amount of requests processed by the application is high, up to 150 pps. I can't understand why these sockets are not disposed and are waiting for something. Could you please give me any advice?
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: Too many open files of type "can't identify protocol"

Post by DarkShadow44 »

Daedroth wrote:I would say when the app works number of files is > 11000, when not it's about 5000.
I thought the problem is too many files? Then why would it work only with > 11000 ?

First, did you make sure it works on windows as expected? Then, did you already try upgrading wine? Your version (1.6.2) is way out of date, a lot as changed since then.
Daedroth
Newbie
Newbie
Posts: 4
Joined: Fri Jun 29, 2018 7:24 pm

Re: Too many open files of type "can't identify protocol"

Post by Daedroth »

Hello,

Maybe that's my poor English :) I mean that during the application launched the lsof | wc -l shows the value around 11000, if I stop it the value is about 5000. It still works but it causes crashes of itself OR other applications started at the same Linux machine. This revealed only at the low-cost VPS where administrator shortened the nofile limit. Earlier I used other (mainly Non-OpenVZ) machines and never hit it, as for Windows there is no limit of simultaneously opened files. I may check it at different Linux machines but I believe it's the same.

As fot the old version, that is the version supplied in the Debian repos, I always use apt-get, never compiling from sources. Exactly I hate compiling from sources in Linux, it's like a russian roulette - one app may be compiled without any problems, as for other you will spend a day looking for the meaning of some errors or installing manually all dependencies (mainly libraries) which are never listed but required for successfull build (it's from personal experience, hit in it few times).
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Too many open files of type "can't identify protocol"

Post by Bob Wya »

Daedroth wrote: ...
As for the old version, that is the version supplied in the Debian repos, I always use apt-get, never compiling from sources. Exactly I hate compiling from sources in Linux, it's like russian roulette - one app may be compiled without any problems... As for another; you will spend a day looking for the meaning of some errors or installing manually all dependencies (mainly libraries) which are never listed but required for successfull build (it's from personal experience, hit in it few times).
Prolly because you've not found Gentoo yet! :wink:

Anyway I'd recommend using the WineHQ pre-built binary packages... See: WineHQ Wiki: Debian.

Code: Select all

sudo dpkg --add-architecture i386
cd
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo sh -c 'echo "deb https://dl.winehq.org/wine-builds/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/winehq-debian-wine.list'
sudo apt-get update
sudo apt-get install --install-recommends winehq-devel
Or as root:

Code: Select all

dpkg --add-architecture i386
cd
wget -nc https://dl.winehq.org/wine-builds/Release.key
apt-key add Release.key
echo "deb https://dl.winehq.org/wine-builds/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/winehq-debian-wine.list
apt-get update
apt-get install --install-recommends winehq-devel
Bob
Locked