MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
15.35k stars 2.55k forks source link

[Bug] 1.18.3 tun模式使用完所有内存 #1178

Open lovitus opened 5 months ago

lovitus commented 5 months ago

Verify steps

Mihomo version

1.18.3

What OS are you seeing the problem on?

Windows

Mihomo config

port: 7890
socks-port: 7891
allow-lan: true
mode: rule
log-level: silent
external-controller: 0.0.0.0:9090
proxy-providers:
...
rule-providers:
...
rules:
...
  - GEOIP,CN,🎯 全球直连
  - MATCH,🐟 漏网之鱼
redir-port: 7892
tproxy-port: 7895
mixed-port: 7893
secret: "123456"
bind-address: "*"
ipv6: true
dns:
    enable: true
    ipv6: false
    enhanced-mode: fake-ip
    fake-ip-range: 198.18.0.1/16
    use-hosts: true
    nameserver: [119.29.29.29, 223.5.5.5, 156.154.70.1, 1.0.0.1]
    fallback: ['208.67.222.222:5353', '208.67.220.220:5353', '208.67.222.220:5353', '208.67.220.222:5353', 'https://1.1.1.1/dns-query', 'https://1.1.1.2/dns-query', 'https://1.1.1.3/dns-query', 'https://1.0.0.1/dns-query', 'https://1.0.0.2/dns-query', 'https://1.0.0.3/dns-query', 'https://45.11.45.11/dns-query', 'https://146.112.41.2/dns-query', 'https://162.159.36.1/dns-query', 'https://162.159.46.1/dns-query', 'https://9.9.9.11:5053/dns-query', 'https://101.6.6.6:8443/dns-query', 'https://208.67.222.222/dns-query', 'https://208.67.220.220/dns-query', 'https://185.222.222.222/dns-query', 'https://101.101.101.101/dns-query', 'https://149.112.112.11:5053/dns-query']
    fallback-filter: null
    geoip: true
    ipcidr: [240.0.0.0/4]
profile:
  store-selected: true

Mihomo log

No response

Description

ipv6启用√, lan启用√,tun启用√,系统代理启用√。 mihomo:1.18.3 , alpha:72df27b 可能相关的issue:

启用tun以后, 两分钟就用了11G,所有内存都用完, 使用alpha版本也是一样。 切回clash premium内核则内存稳定60M

image

wwqgtxx commented 5 months ago

请用最新alpha版本测试,并且打开debug级别日志

lovitus commented 5 months ago
04-10 13:50:40INFO
[TCP] 198.18.0.1:60357(tailscaled.exe) --> 103.84.155.178:443 match Match using 🐟 漏网之鱼[krv4 ss]
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:44357(zerotier-one_x64.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] 198.18.0.1:9993(zerotier-one_x64.exe) --> 103.195.103.66:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] 198.18.0.1:44358(zerotier-one_x64.exe) --> 103.195.103.66:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:9993(zerotier-one_x64.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:44358(zerotier-one_x64.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] 198.18.0.1:44357(zerotier-one_x64.exe) --> 103.195.103.66:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61628(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61631(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61632(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61634(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61636(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61635(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61637(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61638(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61639(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61640(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61641(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61642(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:44INFO
[UDP] [fdfe:dcba:9876::1]:61644(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:45INFO
[UDP] [fdfe:dcba:9876::1]:61643(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:45INFO
[UDP] [fdfe:dcba:9876::1]:61645(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:45INFO
[UDP] [fdfe:dcba:9876::1]:61648(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:45INFO
[UDP] [fdfe:dcba:9876::1]:61647(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
04-10 13:50:45INFO
[UDP] [fdfe:dcba:9876::1]:61646(mihomo-alpha.exe) --> [2605:9880:400:c3:254:f2bc:a1f7:19]:9993 doesn't match any rule using DIRECT
.......................
.......................成千上万条差不多的日志
.......................
.......................
.......................成千上万条差不多的日志
.......................
.......................
.......................成千上万条差不多的日志
.......................
[UDP] [fdfe:dcba:9876::1]:62194(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62195(mihomo-alpha.exe) --> [2a02:6ea0:d405::9993]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62196(mihomo-alpha.exe) --> [2605:9880:200:1200:30:571:e34:51]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62197(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62200(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62198(mihomo-alpha.exe) --> [2a02:6ea0:d405::9993]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62199(mihomo-alpha.exe) --> [2605:9880:200:1200:30:571:e34:51]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62202(mihomo-alpha.exe) --> [2a02:6ea0:d405::9993]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62201(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62203(mihomo-alpha.exe) --> [2605:9880:200:1200:30:571:e34:51]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62204(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62205(mihomo-alpha.exe) --> [2a02:6ea0:d405::9993]:9993 doesn't match any rule using DIRECT
04-10 13:50:50INFO
[UDP] [fdfe:dcba:9876::1]:62206(mihomo-alpha.exe) --> [2001:49f0:d0db:2::2]:9993 doesn't match any rule using DIRECT
wwqgtxx commented 5 months ago

9a572652 也是一样的情况么

lovitus commented 5 months ago

是的 上面的日志基于 alpha-9a57265 Meta 内核 并且是同时开启ipv6+tun才会这样. 如果关闭ipv6, 则运行很稳,内存稳定.

9a57265 也是一样的情况么

Skyxim commented 5 months ago

尝试执行ipconfig看看你本地网卡信息 还有看下日志中绑定的网卡是哪个

lovitus commented 5 months ago

ifconfig


Windows IP Configuration

Ethernet adapter cfw-tap:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter SSTAP 1:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Unknown adapter Tailscale:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : fd7a:[masked]::38
   Link-local IPv6 Address . . . . . : fe80::[masked]9168%68
   IPv4 Address. . . . . . . . . . . : 10.20.[masked]
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wi-Fi 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 18:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter ZeroTier One [fa7[masked]]:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::[masked]:9ad0%26
   IPv4 Address. . . . . . . . . . . : 10.10.[masked]
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : 25.255.255.254

Ethernet adapter Bluetooth Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . : lan
   IPv4 Address. . . . . . . . . . . : 192.168.15.222
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.15.1

部分日志

有一行invalid type: unit value, expected struct FallbackFilter at line 43 column 20 但好像其他时候启动没有这样

URL:
https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt
PATH:
./ruleset/applications.yaml
INTERVAL:
86400
:DNS.FALLBACK-FILTER:
invalid type: unit value, expected struct FallbackFilter at line 43 column 20
04-10 14:28:20INFO
[TCP] mihomo --> 10.20.0.65:25500 match IPCIDR(10.20.0.0/24) using urltest_AUTO n Direct --> tailscale[yx yuexiu]
04-10 14:28:20INFO
Start initial Compatible provider tailscale direct

日志和tun/interface有关的

image

完整日志

2024-04-10-1436.log

wwqgtxx commented 5 months ago

所以你的Ethernet 2本身并没有ipv6地址是吧

lovitus commented 5 months ago

所以你的Ethernet 2本身并没有ipv6地址是吧

是的, 在办公的时候是没有ipv6 (现在) 在家和其它的时候,都有global的公网ipv6地址

wwqgtxx commented 5 months ago

@lovitus 那应该在有公网ipv6地址时工作是正常的?

wwqgtxx commented 5 months ago

再试试 16fadd2 呢

lovitus commented 5 months ago

再试试 16fadd2

這個alpha版本測試通過, 問題已經解決了

lovitus commented 5 months ago

再试试 16fadd2

很厲害,謝謝你

lovitus commented 1 week ago

再试试 16fadd2

1.18.8好像还有这个问题。有一台电脑开了tun电脑的风扇和内存就炸。 Deleaker检查不出泄漏,请问有可以attach到进程的go程序内存使用诊断工具吗?