Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor堆栈导致内核panic (system堆栈无问题) #1197

Open
6 tasks done
moranno opened this issue Apr 16, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@moranno
Copy link

moranno commented Apr 16, 2024

Verify steps

  • 确保你使用的是本仓库最新的的 mihomo 或 mihomo Alpha 版本 Ensure you are using the latest version of Mihomo or Mihomo Alpha from this repository.
  • 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
  • 我已经使用 Alpha 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
  • 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.
  • 这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 This is an issue of the Mihomo core per se, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo.

Mihomo version

1.18.2-d84f88b

What OS are you seeing the problem on?

Windows

Mihomo config

tun:
  mtu: 9000
  stack: gvisor
  device: Meta
  auto-route: true
  strict-route: false
  auto-detect-interface: true
  dns-hijack:
  - any:53
  enable: true
proxies:
 - { name: hk1(hy2), type: hysteria2, server: hk1.server.com, port: 443, ports: 1000-10000, password: 2167f570-ce76-4217-b6a3-5f6ed1b36cf2, skip-cert-verify: true }

Mihomo log

2024-04-17 15:32:12 INFO - [clash]: time="2024-04-17T15:32:12.5600898+08:00" level=warning msg="[TUN] default interface changed by monitor,  => Ethernet"
2024-04-17 15:32:12 ERROR - [clash]: 2024/04/17 15:32:12 http: panic serving 127.0.0.1:56711: runtime error: invalid memory address or nil pointer dereference
2024-04-17 15:32:12 ERROR - [clash]: goroutine 32694 [running]:
2024-04-17 15:32:12 ERROR - [clash]: net/http.(*conn).serve.func1()
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:1898 +0xbe
2024-04-17 15:32:12 ERROR - [clash]: panic({0xee9300?, 0x1b16a30?})
2024-04-17 15:32:12 ERROR - [clash]: 	runtime/panic.go:770 +0x132
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/gvisor/pkg/tcpip/link/channel.(*Endpoint).Attach(0x0, {0x0, 0x0})
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/tcpip/link/channel/channel.go:209 +0x2d
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/sing-tun.(*Mixed).Close(0xc00920e0c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/sing-tun@v0.2.1-0.20240320004934-5d2b35447bfd/stack_mixed.go:264 +0x27
2024-04-17 15:32:12 ERROR - [clash]: github.com/sagernet/sing/common.Close({0xc005df2348?, 0x1bdcf00?, 0x0?})
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/sagernet/sing@v0.3.6/common/cond.go:351 +0x15b
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/listener/sing_tun.(*Listener).Close(0xc0073288c0?)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/listener/sing_tun/server.go:337 +0xef
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/listener/sing_tun.New.func1()
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/listener/sing_tun/server.go:180 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/listener/sing_tun.New({0x1, {0xc0072a0b20, 0x4}, 0x2, {0xc00688b500, 0x1, 0x1}, 0x1, 0x1, {0x1bdcf00, ...}, ...}, ...)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/listener/sing_tun/server.go:271 +0x1aee
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/listener.ReCreateTun({0x1, {0xc0072a0b20, 0x4}, 0x2, {0xc00688b500, 0x1, 0x1}, 0x1, 0x1, {0x1bdcf00, ...}, ...}, ...)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/listener/listener.go:534 +0x1af
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/hub/executor.updateTun(0xc00adca508)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/hub/executor/executor.go:356 +0x9e
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/hub/executor.ApplyConfig(0xc005dd4000, 0x0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/hub/executor/executor.go:103 +0x286
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/hub/route.updateConfigs({0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/hub/route/configs.go:367 +0x28f
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0xc0017be3c0?, {0x1269ca0?, 0xc0069f8460?}, 0x1255370?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc00021d2c0, {0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/mux.go:459 +0x2e6
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0xc0051f0c30?, {0x1269ca0?, 0xc0069f8460?}, 0x10?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc00021d2c0, {0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/mux.go:73 +0x32f
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*Mux).Mount.func1({0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/mux.go:327 +0x1bb
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0x2f3424?, {0x1269ca0?, 0xc0069f8460?}, 0xc002a6d8e0?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/hub/route.authentication.func1({0x1269ca0?, 0xc0069f8460?}, 0xc0043d5918?)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/hub/route/server.go:171 +0x293
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0xc000eb9a40?, {0x1269ca0?, 0xc0069f8460?}, 0x0?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*ChainHandler).ServeHTTP(0xc0017be3c0?, {0x1269ca0?, 0xc0069f8460?}, 0xc002b6e2bc?)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/chain.go:31 +0x26
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000106120, {0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/mux.go:459 +0x2e6
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0xc0028880a0?, {0x1269ca0?, 0xc0069f8460?}, 0xc0073be6c0?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/cors.(*Cors).Handler-fm.(*Cors).Handler.func1({0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/cors@v1.2.1/cors.go:228 +0x17e
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0x30?, {0x1269ca0?, 0xc0069f8460?}, 0x1f5fb2c8d78?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/metacubex/mihomo/hub/route.setPrivateNetworkAccess.func1({0x1269ca0, 0xc0069f8460}, 0xc0073be6c0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/metacubex/mihomo/hub/route/server.go:158 +0x1a2
2024-04-17 15:32:12 ERROR - [clash]: net/http.HandlerFunc.ServeHTTP(0x126c810?, {0x1269ca0?, 0xc0069f8460?}, 0x1b19370?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2166 +0x29
2024-04-17 15:32:12 ERROR - [clash]: github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000106120, {0x1269ca0, 0xc0069f8460}, 0xc0073be5a0)
2024-04-17 15:32:12 ERROR - [clash]: 	github.com/go-chi/chi/v5@v5.0.12/mux.go:90 +0x2ee
2024-04-17 15:32:12 ERROR - [clash]: net/http.serverHandler.ServeHTTP({0x1263668?}, {0x1269ca0?, 0xc0069f8460?}, 0x6?)
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:3137 +0x8e
2024-04-17 15:32:12 ERROR - [clash]: net/http.(*conn).serve(0xc00727a990, {0x126c7d8, 0xc00298e4b0})
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:2039 +0x5e8
2024-04-17 15:32:12 ERROR - [clash]: created by net/http.(*Server).Serve in goroutine 68
2024-04-17 15:32:12 ERROR - [clash]: 	net/http/server.go:3285 +0x4b4

Description

我这边用户大规模反馈,自从升级到1.18.2-最新版的alpha构建d84f88b),tun模式使用gvisor,平凡出现断流。
同时测试了tun模式的system堆栈,不会断流和panic
表现为:
用1-3分钟后,断流,过几分钟又能连上。

@moranno moranno added the bug Something isn't working label Apr 16, 2024
@xishang0128
Copy link

请本人使用并反馈,否则不易于跟踪问题,另外这有可能是中间链路的问题,最好是本地复现之后,再来反馈

@moranno moranno changed the title [Bug] 鸡场主反馈,hysteria2开启端口跳跃的情况下,使用1.18.2及以后版本平凡出现断流 [Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor导致的问题内核panic Apr 17, 2024
@moranno
Copy link
Author

moranno commented Apr 17, 2024

请本人使用并反馈,否则不易于跟踪问题,另外这有可能是中间链路的问题,最好是本地复现之后,再来反馈

更新了日志和说明,请查看。

@moranno moranno changed the title [Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor导致的问题内核panic [Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor导致的问题内核panic(system堆栈无问题) Apr 17, 2024
@moranno moranno changed the title [Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor导致的问题内核panic(system堆栈无问题) [Bug] 更新!鸡场主反馈,不是端口跳跃导致的问题,是tun模式gvisor堆栈导致内核panic (system堆栈无问题) Apr 17, 2024
@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 17, 2024

这个panic两周前就修过了
b56e73a

@gs507
Copy link

gs507 commented Apr 17, 2024

这个panic两周前就修过了 b56e73a

问题在mixed和givisor中依旧,system正常

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 17, 2024

@gs507 请附上最新版本出错的日志

@gs507
Copy link

gs507 commented Apr 17, 2024

@gs507 请附上最新版本出错的日志

如上,就是我给的日志

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 17, 2024

你那个日志明显不是最新版的

@gs507
Copy link

gs507 commented Apr 17, 2024

@wwqgtxx 最新log发出来了(ff2071c)

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Apr 17, 2024

@gs507 麻烦发核心的日志,你发verge有啥用

@moranno
Copy link
Author

moranno commented Apr 17, 2024

2024-04-18-0058.log @wwqgtxx 这个应该是

看了下你最新的日志中没有panic的记录,反而有很多dns查询错误的记录

time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS Server] Exchange ;www.msftconnecttest.com.\tIN\t AAAA failed: all DNS requests failed, first error: connect failed: dial udp 114.114.115.115:53: i/o timeout"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from https://dns.alidns.com:443/dns-query"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS Server] Exchange ;www.msftconnecttest.com.\tIN\t AAAA failed: all DNS requests failed, first error: connect failed: dial udp 114.114.115.115:53: i/o timeout"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://223.6.6.6:53"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS Server] Exchange ;www.msftconnecttest.com.\tIN\t AAAA failed: all DNS requests failed, first error: connect failed: dial udp 114.114.115.115:53: i/o timeout"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS Server] Exchange ;www.msftconnecttest.com.\tIN\t AAAA failed: all DNS requests failed, first error: connect failed: dial udp 114.114.115.115:53: i/o timeout"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from https://doh.pub:443/dns-query"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from https://dns.rubyfish.cn:443/dns-query"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from https://223.6.6.6:443/dns-query"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] resolve www.msftconnecttest.com from udp://180.76.76.76:53"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] cache hit for dns.rubyfish.cn., expire at 2024-04-18 01:00:06"
time="2024-04-18T00:58:58.2857129+08:00" level=debug msg="[DNS] cache hit for dns.rubyfish.cn., expire at 2024-04-18 01:03:39"
time="2024-04-18T00:58:58.2867519+08:00" level=info msg="[TCP] 198.18.0.1:58427 --> www.msftconnecttest.com:80 using GLOBAL"
time="2024-04-18T00:58:58.2929411+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from https://dns.alidns.com:443/dns-query"
time="2024-04-18T00:58:58.2950075+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from udp://223.6.6.6:53"
time="2024-04-18T00:58:58.2988522+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from https://223.6.6.6:443/dns-query"
time="2024-04-18T00:58:58.2988522+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from https://doh.pub:443/dns-query"
time="2024-04-18T00:58:58.3002359+08:00" level=debug msg="[DNS] www.msftconnecttest.com --> [] AAAA from udp://180.76.76.76:53"

@gs507
Copy link

gs507 commented Apr 17, 2024

@wwqgtxx 但这无法解释discord语音服务器频繁掉线的问题

@gs507
Copy link

gs507 commented Apr 17, 2024

shadowsocks暂时无问题,而hy2问题延伸到system了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants