MetaCubeX / mihomo

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

[Bug] 多次内核崩溃 panic: runtime error #919

Closed Brbrbr1995 closed 10 months ago

Brbrbr1995 commented 10 months ago

Verify steps

Mihomo version

Mihomo Meta alpha-9fc1fc4 windows amd64 with go1.21.5 Sun Dec 10 00:33:26 UTC 2023 Use tags: with_gvisor

What OS are you seeing the problem on?

Windows

Mihomo config

log-level: debug

profile:
  store-selected: true
  store-fake-ip: false

#██████████████████████
#███  █████   ████  ███
#███  █████    ███  ███
#███  █████  █  ██  ███
#███  █████  ██  █  ███
#███  █████  ███    ███
#██████████████████████

allow-lan: true
bind-address: "*"

ipv6: false

port: 35511
socks-port: 35512
mixed-port: 35513

listeners:
  - name: SKSIN
    type: socks
    listen: 0.0.0.0
    port: 35514
    udp: true
    rule: SKSIN

tun:
  enable: true
  stack: system
  auto-route: true
  auto-detect-interface: true
  mtu: 1450
  dns-hijack:
    - any:53
    - tcp://any:53

dns:
  enable: true
  listen: 0.0.0.0:53
  ipv6: false
  enhanced-mode: redir-host
  use-hosts: true
  prefer-h3: false

  nameserver-policy:

  proxy-server-nameserver:
    - tls://8.8.4.4:853#⏱
    - tls://208.67.220.220:853#⏱
    - https://1.0.0.1/dns-query#h3=true&⏱
  default-nameserver:
    - tls://8.8.4.4:853#⏱
    - tls://208.67.220.220:853#⏱
    - https://1.0.0.1/dns-query#h3=true&⏱
  nameserver:
    - tls://8.8.4.4:853#⏱
    - tls://208.67.220.220:853#⏱
    - https://1.0.0.1/dns-query#h3=true&⏱

#██████████████████████████████████████████████████
#███      ██████  ████  █████  ██████████       ███
#███  ███  █████  ████  █████  ██████████  ████████
#███      ██████  ████  █████  ██████████     █████
#███  ███  █████  ████  █████  ██████████  ████████
#███  ███  ██████      ██████       █████       ███
#██████████████████████████████████████████████████

mode: rule

find-process-mode: always

geodata-mode: false

geox-url:
  mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb"
  geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
  geosite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"

geodata-loader: standard

rule-providers:

  Chrome_Process:
    type: http
    behavior: classical
    url: "http://192.168.1.14/Rule/Chrome_Process.yaml"
    path: ./Provider/Rule/Chrome_Process.yaml
    interval: 60

  GHLS_PrivateDomain:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
    path: ./Provider/Rule/GitHub/GHLS_PrivateDomain.txt
    interval: 3600

  GHLS_LocaIP:
    type: http
    behavior: ipcidr
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
    path: ./Provider/Rule/GitHub/GHLS_LocaIP.txt
    interval: 3600

  GHLS_GoogleChinaDomain:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt"
    path: ./Provider/Rule/GitHub/GHLS_GoogleChinaDomain.txt
    interval: 3600

  GHLS_DirectDomain:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
    path: ./Provider/Rule/GitHub/GHLS_DirectDomain.txt
    interval: 3600

rules:
###   LAN
  - RULE-SET,GHLS_PrivateDomain,🖧
  - RULE-SET,GHLS_LocaIP,🖧

  - RULE-SET,GHLS_GoogleChinaDomain,🌎
  - RULE-SET,GHLS_DirectDomain,🇨🇳
  - GEOIP,CN,🇨🇳
  - MATCH,🌎

sub-rules:

  SKSIN:
    - DOMAIN-SUFFIX,xxxxxxxxxx.pro,🌎
    - MATCH,REJECT

#████████████████████████████████████████
#████      ██████  ████  █████        ███
#███  ████  █████  ████  ████████  ██████
#███  ████  █████  ████  ████████  ██████
#███  ████  █████  ████  ████████  ██████
#████      ███████      █████████  ██████
#████████████████████████████████████████

unified-delay: false
tcp-concurrent: true
keep-alive-interval: 3
global-client-fingerprint: chrome

sniffer:
  enable: true
  force-dns-mapping: true
  parse-pure-ip: true
  override-destination: true
  sniff:
    HTTP:
      ports: [1-65535]
      override-destination: true
    TLS:
      ports: [1-65535]
      override-destination: true
    QUIC:
      ports: [1-65535]
      override-destination: true
  force-domain:
  skip-domain:

proxy-providers:

  Abroad:
    type: http
    url: "http://192.168.1.14/Proxy/Abroad.yaml"
    path: ./Provider/Proxy/Abroad.yaml
    interval: 60
    health-check:
      enable: true
      interval: 30
      lazy: false
      url: "https://www.google.com/"

proxy-groups:

  - name: '🖧'
    type: select
    disable-udp: false
    proxies:
      - DIRECT
      - REJECT
    use:
      - Abroad

  - name: '🇨🇳'
    type: select
    disable-udp: false
    proxies:
      - DIRECT
      - REJECT
    use:
      - Abroad

  - name: '🌎'
    type: select
    disable-udp: false
    proxies:
      - DIRECT
      - REJECT
      - 👆
      - ⏱
      - ✅

  - name: '👆'
    type: select
    disable-udp: false
    proxies:
    use:
      - Abroad

  - name: '⏱'
    type: url-test
    disable-udp: false
    tolerance: 100
    proxies:
    use:
      - Abroad

  - name: '✅'
    type: fallback
    disable-udp: false
    proxies:
    use:
      - Abroad

proxies:

Mihomo log

time="2023-12-17T15:13:33.9921645+08:00" level=debug msg="use specified fingerprint:Chrome"
time="2023-12-17T15:13:34.4357918+08:00" level=debug msg="Health Checked, proxy: 12|🇺🇸|US|美国|@wxgq  lfx|63, url: https://www.google.com/, alive: true, delay: 1617 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:34.4378717+08:00" level=debug msg="Health Checked, proxy: |51.45Mb, url: https://www.google.com/, alive: true, delay: 1620 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:34.5896223+08:00" level=debug msg="Health Checked, proxy: 16|🇹🇼 台湾3|@ripaoj  iedian, url: https://www.google.com/, alive: true, delay: 624 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:34.6047192+08:00" level=debug msg="Health Checked, proxy: |11.09Mb, url: https://www.google.com/, alive: true, delay: 1530 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:34.6805104+08:00" level=debug msg="Health Checked, proxy: 12|IN_speednode_0030, url: https://www.google.com/, alive: true, delay: 1668 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:34.892011+08:00" level=debug msg="Health Checked, proxy: |10.32Mb, url: https://www.google.com/, alive: true, delay: 1537 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:35.0111244+08:00" level=debug msg="Health Checked, proxy: 12|🇺🇸|US|美国|@wxgq  lfx|66, url: https://www.google.com/, alive: true, delay: 1495 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:35.1364136+08:00" level=debug msg="Health Checked, proxy: 12|🇺🇸|US|美国|@wxgq  lfx|62, url: https://www.google.com/, alive: true, delay: 1473 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:35.4423248+08:00" level=debug msg="Health Checked, proxy: |15.46Mb, url: https://www.google.com/, alive: true, delay: 1750 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:37.5876959+08:00" level=debug msg="Health Checked, proxy: US_870 |30.21Mb, url: https://www.google.com/, alive: false, delay: 65535 ms uid: {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:37.5876959+08:00" level=debug msg="Finish A Health Checking {92b46671-11e2-49ef-a803-afa5c3017ab5}"
time="2023-12-17T15:13:38.5046863+08:00" level=debug msg="[Sniffer] All sniffing sniff failed with from [198.18.0.1:7451] to [172.23.16.1:445]"
time="2023-12-17T15:13:38.5046863+08:00" level=debug msg="[Rule] use default rules"
panic: runtime error: slice bounds out of range [:3] with capacity 1

goroutine 17659 [running]:
github.com/metacubex/mihomo/component/process.convertDOSPath({0x1aa80ef, 0x7})
        github.com/metacubex/mihomo/component/process/process_windows.go:246 +0x272
github.com/metacubex/mihomo/component/process.findProcessName({0x1aa612b, 0x0?}, {{0x0?, 0xc000f04300?}, 0xc000118048?}, 0x1d1b)
        github.com/metacubex/mihomo/component/process/process_windows.go:109 +0x196
github.com/metacubex/mihomo/component/process.FindProcessName(...)
        github.com/metacubex/mihomo/component/process/process.go:20
github.com/metacubex/mihomo/tunnel.match(0xc001062000)
        github.com/metacubex/mihomo/tunnel/tunnel.go:624 +0x385
github.com/metacubex/mihomo/tunnel.resolveMetadata(0xc000109180?)
        github.com/metacubex/mihomo/tunnel/tunnel.go:297 +0x71
github.com/metacubex/mihomo/tunnel.handleTCPConn({0x1c8de10, 0xc00070a540})
        github.com/metacubex/mihomo/tunnel/tunnel.go:485 +0x2b6
github.com/metacubex/mihomo/tunnel.tunnel.HandleTCPConn({}, {0x1c98588?, 0xc000078570?}, 0x0?)
        github.com/metacubex/mihomo/tunnel/tunnel.go:59 +0x2c
github.com/metacubex/mihomo/listener/sing.(*ListenerHandler).NewConnection(0xc00039a380, {0x1c90d98, 0x270b620}, {0x1c98588, 0xc000078570?}, {{0x0, 0x0}, {{{0x0, 0xffffc6120001}, 0xc000118048}, ...}, ...})
        github.com/metacubex/mihomo/listener/sing/sing.go:136 +0x50a
github.com/metacubex/mihomo/listener/sing_tun.(*ListenerHandler).NewConnection(0xc000398320, {0x1c90d98, 0x270b620}, {0x1c98588?, 0xc000078570}, {{0x0, 0x0}, {{{0x0, 0xffffc6120001}, 0xc000118048}, ...}, ...})
        github.com/metacubex/mihomo/listener/sing_tun/dns.go:98 +0x23f
github.com/metacubex/sing-tun.(*System).acceptLoop.func1()
        github.com/metacubex/sing-tun@v0.1.15-0.20231210002555-d1b0097255dd/stack_system.go:233 +0x142
created by github.com/metacubex/sing-tun.(*System).acceptLoop in goroutine 52
        github.com/metacubex/sing-tun@v0.1.15-0.20231210002555-d1b0097255dd/stack_system.go:232 +0x43c

D:\Mihomo>pause
Press any key to continue . . .

Description

局域网内共享配置文件和provider的机器离线时clash内核崩溃:panic: runtime error: slice bounds out of range [:3] with capacity 1

wwqgtxx commented 10 months ago

请更新到最新alpha