evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.91k stars 509 forks source link

too many open files error #263

Closed gustavo-iniguez-goya closed 3 years ago

gustavo-iniguez-goya commented 5 years ago

Hi,

From time to time I run into this problem where the connections doesn't show up on the UI. I've seen this error reported in other issues (#185), but not a specific issue for this problem, so I've decided to open a new one:

(...)
[2019-06-16 18:34:23]  WAR  Error while searching for udp6 netstat entry: open /proc/net/udp6: too many open files
[2019-06-16 18:34:23]  WAR  Error while searching for tcp netstat entry: open /proc/net/tcp: too many open files
[2019-06-16 18:34:23]  WAR  Error while searching for tcp6 netstat entry: open /proc/net/tcp6: too many open files

^C
[2019-06-16 18:35:27]  IMP  Got signal: interrupt
[2019-06-16 18:35:27]  INF  Cleaning up ...
ERROR: path=/usr/sbin/iptables args=[-D INPUT --protocol udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass] err=open /dev/null: too many open files out=''
ERROR: path=/usr/sbin/iptables args=[-D OUTPUT -t mangle -m conntrack --ctstate NEW -j NFQUEUE --queue-num 0 --queue-bypass] err=open /dev/null: too many open files out=''
ERROR: path=/usr/sbin/iptables args=[-D OUTPUT -m mark --mark 101285 -j DROP] err=open /dev/null: too many open files out=''

I'm still trying to find a reliable way of reproducing it. I'll update the issue if I find it.

gustavo-iniguez-goya commented 5 years ago

Due to this problem, another issue has arised when showing the prompt dialog:

E0627 09:44:18.919951020   11890 tcp_server_posix.cc:210]    Failed accept4: Too many open files
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/opensnitch/dialogs/prompt.py", line 94, in on_connection_prompt_triggered
  File "/usr/local/lib/python3.7/dist-packages/opensnitch/dialogs/prompt.py", line 140, in _render_connection
KeyError: 'getpwuid(): uid not found: 1010'
gustavo-iniguez-goya commented 5 years ago

if the UI is not open and connected to the UI, the daemon has very few files opened:

ls -l /proc/11049/fd/|wc -l
11

However, when the UI client connects and disconnects, the number of opened files by the daemon grows up with no limit:

v@$ ls -l /proc/11049/fd/|wc -l
451
v@$ ls -l /proc/11049/fd/|wc -l
958
v@$ ls -l /proc/11049/fd/|wc -l
1025
v@$ netstat -nxp |grep opensnitchd|wc -l
1014
netstat -evnWxp |grep osui|wc -l
1039

unix 3 [ ] STREAM CONNECTED 6516857 11049/./opensnitchd