MetaCubeX / mihomo

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

[Bug] 使用tuic时Go标准库中atomic原子操作int64有崩溃bug #783

Closed sshpem closed 12 months ago

sshpem commented 1 year ago

Verify steps

Clash version

Clash Meta v1.16.0 linux arm with go1.21.1 Mon Sep 25 11:37:47 UTC 2023

What OS are you seeing the problem on?

Linux

Clash config

- name: node-tuic
    type: tuic
    server: xxxx.xxxx.com
    port: 18011
    uuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    password: this is password
    congestion-controller: bbr

Clash log

Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: panic: unaligned 64-bit atomic operation
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: goroutine 1824 [running]:
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: runtime/internal/atomic.panicUnaligned()
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       runtime/internal/atomic/unaligned.go:8 +0x24
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: runtime/internal/atomic.Load64(0x2fded34)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       runtime/internal/atomic/atomic_arm.s:280 +0x14
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/puzpuzpuz/xsync/v2.(*MapOf[...]).resizeInProgress(...)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/puzpuzpuz/xsync/v2@v2.5.0/mapof.go:431
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/puzpuzpuz/xsync/v2.(*MapOf[...]).doCompute(0x11afb80, 0xa5cf, 0x2d85a10, 0x1, 0x0)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/puzpuzpuz/xsync/v2@v2.5.0/mapof.go:310 +0x1bc
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/puzpuzpuz/xsync/v2.(*MapOf[...]).LoadOrStore(0x11afb80, 0xa5cf, {0x11a6c3c, 0x2e04820})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/puzpuzpuz/xsync/v2@v2.5.0/mapof.go:199 +0x80
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/transport/tuic/v5.(*clientImpl).ListenPacketWithDialer(0x2fded00, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x119c048, 0x2fb7d70}, 0x2c23470)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/transport/tuic/v5/client.go:355 +0x1a8
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/transport/tuic/v5.(*Client).ListenPacketWithDialer(0x2c851b8, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x119c048, 0x2fb7d70}, 0x2c23470)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/transport/tuic/v5/client.go:393 +0x50
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/transport/tuic.(*PoolClient).ListenPacketWithDialer(0x2d7d900, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x119c048, 0x2fb7d70}, 0x2c851a8)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/transport/tuic/pool_client.go:54 +0xc8
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/adapter/outbound.(*Tuic).ListenPacketWithDialer(0x2c930a0, {0x11a26e0, 0x2f9f2c0}, {0x119c048, 0x2fb7d70}, 0x2ffb900)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/adapter/outbound/tuic.go:114 +0x464
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/adapter/outbound.(*Tuic).ListenPacketContext(0x2c930a0, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x0, 0x0, 0x0})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/adapter/outbound/tuic.go:83 +0xc0
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/adapter.(*Proxy).ListenPacketContext(0x2d7d940, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x0, 0x0, 0x0})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/adapter/adapter.go:80 +0x58
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/adapter/outboundgroup.(*Selector).ListenPacketContext(0x2c937c0, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x0, 0x0, 0x0})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/adapter/outboundgroup/selector.go:31 +0xa4
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/adapter.(*Proxy).ListenPacketContext(0x2d7dca0, {0x11a26e0, 0x2f9f2c0}, 0x2ffb900, {0x0, 0x0, 0x0})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/adapter/adapter.go:80 +0x58
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/tunnel.handleUDPConn.func2.2({0x11a26e0, 0x2f9f2c0})
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/tunnel/tunnel.go:363 +0x11c
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/tunnel.retry[...]({0x11a26e0, 0x2f9f2c0}, 0x2d85eb8, 0x2d85f74)
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/tunnel/tunnel.go:653 +0xb0
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: github.com/Dreamacro/clash/tunnel.handleUDPConn.func2()
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/tunnel/tunnel.go:362 +0x27c
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]: created by github.com/Dreamacro/clash/tunnel.handleUDPConn in goroutine 5
Thu Oct  5 21:07:15 2023 daemon.err clash[32465]:       github.com/Dreamacro/clash/tunnel/tunnel.go:337 +0x40c

Description

openwrt 21.02.7,armv7,一旦切换到tuic节点就报错,然后crash,其他类型节点(比如ss、trojan-go)都运行正常。

Cl-He-O commented 12 months ago

这是一个上游的问题(github.com/puzpuzpuz/xsync)