clash_for_windows_pkg
clash_for_windows_pkg copied to clipboard
[Bug]: 遇到需要直连的网站,clash会崩溃无反应,必须重启clash
请认真检查以下清单中的每一项
- [X] 已经搜索过,没有发现类似issue
- [ ] 已经搜索过文档,没有发现相关内容
- [x] 已经尝试使用过最新版,问题依旧存在
- [x] 使用的是官方版本(未替换及修改过安装目录程序文件)
软件版本
0.19.25
操作系统
Windows x64
系统版本
Win 10
问题描述
此问题有点类似 issue #2871
当访问一部分需要直连的网站或URL,就会突然断连,所有网站都上不去,包括百度等。但有时候刚开始访问一些直连网站是正常的,过几分钟就会发生断连。 clash界面会无任何反应,必须重启clash才有效。此状况会不定时发生。 此现象只影响所有网页,因为即使clash断连后,微信电脑版还可以正常登录。
我看过 issue #312 。一开始我以为是某个软件或浏览器插件导致的问题,可是浏览器插件全部停用,甚至换了台电脑还是有上述情。 但同样的机场规则,导入到 ShadowsocksR 可以正常访问各类网站,并没用出现断连。手机上用Clash也正常。
经过搜索,也许和 goroutine deadlock 相关?【只是一个观察,并不一定对】 https://stackoverflow.com/questions/64050104/golang-keeps-crashing-on-running-main-go-with-exception-exception-0xc0000005 我遇到的情况与此相似。
复现步骤
开启Clash, 在chrome或Firefoxzho中访问知乎,哔哩哔哩,中国大陆的一些小众网站,或者类似"fe2.update.microsoft.com", “ocsp.pki.goog” URL时,网络(浏览器)会断连,导致所有网站都无法上去,包括百度,哔哩哔哩等。必须重启clash才可以重新访问各类网站。
并不是任何时候访问知乎,哔哩哔哩等直连网站就会瞬间断连,有时访问知乎或哔哩哔哩十几分钟后才会断连。 但当我看log日志人为去访问 "fe2.update.microsoft.com"时,会瞬间断连。
日志文件
一共三个日志,都是截取了断连的那时候前后log。有时候在最后一条访问记录后,log会记录 exception error 代码 (很长很长)。后两条日志就没有此类错误代码。
logs
time="2022-07-30T01:39:23+08:00" level=info msg="[TCP] 127.0.0.1:14773 --> clients2.google.com:443 match DomainKeyword(google) using 🔰国外流量[🇭🇰 V304U-1X-BGP-HK-NF]" time="2022-07-30T01:39:24+08:00" level=info msg="[TCP] 127.0.0.1:14776 --> safebrowsing.googleapis.com:443 match DomainKeyword(google) using 🔰国外流量[🇭🇰 V304U-1X-BGP-HK-NF]" time="2022-07-30T01:39:25+08:00" level=info msg="[TCP] 127.0.0.1:14778 --> ocsp.pki.goog:80 match GeoIP(CN) using DIRECT" Exception 0xc0000005 0x0 0x1 0x180046892 PC=0x180046892
runtime.cgocall(0xf75aa0, 0xc00039e6c0)
runtime/cgocall.go:157 +0x4a fp=0xc0001f5868 sp=0xc0001f5830 pc=0xf1456a
syscall.SyscallN(0xc00003d680?, {0xc0001f5900?, 0xc0001f5944?, 0xc00074e000?})
runtime/syscall_windows.go:538 +0x109 fp=0xc0001f58e0 sp=0xc0001f5868 pc=0xf70c89
syscall.Syscall9(0xf49ac0?, 0xc0001a9860?, 0x3?, 0xc0001f59b8?, 0xf17032?, 0x164ea00?, 0xce?, 0xc0001f5b78?, 0x3?, 0x0, ...)
runtime/syscall_windows.go:488 +0x78 fp=0xc0001f5958 sp=0xc0001f58e0 pc=0xf70a98
syscall.WSASend(0xf248a6?, 0x10003fc771900?, 0x1, 0xfe5352?, 0x0, 0x0?, 0x0?)
syscall/zsyscall_windows.go:1311 +0xb9 fp=0xc0001f59f0 sp=0xc0001f5958 pc=0xfc40f9
internal/poll.(*FD).Write.func1(0xc000048a00?)
internal/poll/fd_windows.go:696 +0x39 fp=0xc0001f5a38 sp=0xc0001f59f0 pc=0xfe9239
internal/poll.execIO(0xc0000de0e8, 0x17e3978)
internal/poll/fd_windows.go:159 +0x78 fp=0xc0001f5a90 sp=0xc0001f5a38 pc=0xfe6a58
internal/poll.(*FD).Write(0xc0000de000, {0xc000232000, 0x141, 0x8000})
internal/poll/fd_windows.go:695 +0x33b fp=0xc0001f5b38 sp=0xc0001f5a90 pc=0xfe959b
net.(*netFD).Write(0xc0000de000, {0xc000232000?, 0xc00039a960?, 0x0?})
net/fd_posix.go:96 +0x29 fp=0xc0001f5b80 sp=0xc0001f5b38 pc=0x1029be9
net.(*conn).Write(0xc000186060, {0xc000232000?, 0x103f545?, 0xc0004d0080?})
net/net.go:195 +0x45 fp=0xc0001f5bc8 sp=0xc0001f5b80 pc=0x103d005
github.com/Dreamacro/clash/adapter/outbound.(*conn).Write(0x8000?, {0xc000232000?, 0x0?, 0x0?})
goroutine 1 [chan receive, 5 minutes]: main.main() github.com/Dreamacro/clash/main.go:108 +0x89f
goroutine 6 [syscall, 5 minutes, locked to thread]: syscall.SyscallN(0x7ff877d58c90?, {0xc000086000?, 0x2?, 0x0?}) runtime/syscall_windows.go:538 +0x109 github.com/Dreamacro/clash/component/iface.startAddrMonitor.func1() github.com/Dreamacro/clash/component/iface/iface_windows.go:22 +0x65 created by github.com/Dreamacro/clash/component/iface.startAddrMonitor github.com/Dreamacro/clash/component/iface/iface_windows.go:20 +0x45
goroutine 7 [chan receive]: github.com/Dreamacro/clash/common/observable.(*Observable[...]).process(0xc0000425c0) github.com/Dreamacro/clash/common/observable/observable.go:16 +0x65 created by github.com/Dreamacro/clash/common/observable.NewObservable[...] github.com/Dreamacro/clash/common/observable/observable.go:63 +0xcf
logs
time="2022-07-30T02:16:40+08:00" level=info msg="[TCP] 127.0.0.1:4027 --> geo.prod.do.dsp.mp.microsoft.com:443 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:40+08:00" level=info msg="[TCP] 127.0.0.1:4029 --> kv801.prod.do.dsp.mp.microsoft.com:443 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:40+08:00" level=info msg="[TCP] 127.0.0.1:4031 --> v10.events.data.microsoft.com:443 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:41+08:00" level=info msg="[TCP] 127.0.0.1:4033 --> rr5---sn-i3belnl6.googlevideo.com:443 match DomainKeyword(google) using 🔰国外流量[🇭🇰 V304U-1X-BGP-HK-NF]"
time="2022-07-30T02:16:42+08:00" level=info msg="[TCP] 127.0.0.1:4035 --> cp801.prod.do.dsp.mp.microsoft.com:443 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:43+08:00" level=info msg="[TCP] 127.0.0.1:4038 --> dl.delivery.mp.microsoft.com:80 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:43+08:00" level=info msg="[TCP] 127.0.0.1:4040 --> 8.tlu.dl.delivery.mp.microsoft.com:80 match DomainSuffix(microsoft.com) using DIRECT"
time="2022-07-30T02:16:43+08:00" level=info msg="[TCP] 127.0.0.1:4041 --> 8.tlu.dl.delivery.mp.microsoft.com:80 match DomainSuffix(microsoft.com) using DIRECT"
logs
time="2022-07-30T01:30:47+08:00" level=info msg="[TCP] 127.0.0.1:13986 --> detectportal.firefox.com:80 match Match() using ⚓️其他流量[🇭🇰 V304U-1X-BGP-HK-NF]" time="2022-07-30T01:30:47+08:00" level=info msg="[TCP] 127.0.0.1:13988 --> detectportal.firefox.com:80 match Match() using ⚓️其他流量[🇭🇰 V304U-1X-BGP-HK-NF]" time="2022-07-30T01:30:47+08:00" level=info msg="[TCP] 127.0.0.1:13991 --> edge.microsoft.com:443 match DomainSuffix(microsoft.com) using DIRECT" time="2022-07-30T01:30:47+08:00" level=info msg="[TCP] 127.0.0.1:13990 --> fe2.update.microsoft.com:80 match DomainSuffix(microsoft.com) using DIRECT" time="2022-07-30T01:30:50+08:00" level=info msg="[TCP] 127.0.0.1:13996 --> fe2.update.microsoft.com:80 match DomainSuffix(microsoft.com) using DIRECT"
其他补充
我并不懂太多network此方面知识,也不敢确定这到底是我的PC问题,还是clash本身的bug,请谅解。 上面提到的 goroutine deadlock,https://stackoverflow.com/questions/64050104/golang-keeps-crashing-on-running-main-go-with-exception-exception-0xc0000005 我也不确定是否就是此类故障,只是提供一个猜想
进一步观察,发现在访问直连网站时用 80端口会出现上述情况。 比如“ ctldl.windowsupdate.com:80”,“ zhihu.com:80 match DomainSuffix(zhihu.com) using DIRECT" 不知道解决办法是什么,这方面真的不太懂。😂
Exception 0xc0000005
既然是 Clash 崩溃,上游有一个相似的报告,也没查出结果。去问问?
微信电脑版还可以正常登录
微信好像不服从系统代理吧?(登录界面 > 网络代理设置 默认是“关闭”)
不受影响在情理之中。
看了一下上游的那个issue,确实和我的这个很相似。
我也有这种问题,有时候B站和英雄联盟打不开,但是无痕模式就没问题,无语了,不知道什么情况
https://github.com/Fndroid/clash_for_windows_pkg/issues/2871#issuecomment-1270005428
Maybe this could be the problem?