hiddify / hiddify-next

Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc. It’s an open-source, secure and ad-free.
https://hiddify.com
Other
16.05k stars 1.47k forks source link

Hiddify Crash problem #926

Closed aminmr closed 1 month ago

aminmr commented 4 months ago

Search first

What Happened?

The Hiddify-next application crashes after enabling the connection. At Android OS, I can't extract any log for this problem and only find out that the problem happens when the app tries sorting configs by latency multiple times. If you try this manually the app will crash. I gather the log of the app by launching the app by Linux which I provide this logs in the following section If you need more logs and information, please let me know.

Minimal Reproducible Example (MRE)

  1. Run connection
  2. Go to the proxies section
  3. Try to sort the config by latency multiple times
  4. The app will crush

Expected Behavior

The app works fine :))

Version

v1.1.1

Platform/OS

Linux

Additional Context

No response

Application Config Options

No response

Relevant log output

panic: runtime error: slice bounds out of range [:194] with capacity 123

goroutine 1665 [running]:
github.com/sagernet/sing-box/common/dialer.(*fragmentConn).Write(0xc0005fea00, {0xc0006c0200, 0x52, 0x80})
    github.com/sagernet/sing-box@v1.8.9/common/dialer/fragment.go:62 +0x2f0
github.com/sagernet/ws.WriteFrame({0x7fbb3a364620, 0xc0005fea00}, {{0x1, 0x0, 0x2, 0x1, {0xc8, 0x76, 0x17, 0x35}, ...}, ...})
    github.com/sagernet/ws@v0.0.0-20231204124109-acfe8907c854/write.go:95 +0x50
github.com/sagernet/ws/wsutil.writeFrame({0x7fbb3a364620?, 0xc0005fea00?}, 0x0?, 0x2?, 0x1?, {0xc000a9c000?, 0x52?, 0x6c?})
    github.com/sagernet/ws@v0.0.0-20231204124109-acfe8907c854/wsutil/writer.go:570 +0x2f0
github.com/sagernet/ws/wsutil.WriteMessage(...)
    github.com/sagernet/ws@v0.0.0-20231204124109-acfe8907c854/wsutil/helper.go:161
github.com/sagernet/sing-box/transport/v2raywebsocket.(*WebsocketConn).Write(0xc0002eb100, {0xc000a9c000, 0x52, 0x80})
    github.com/sagernet/sing-box@v1.8.9/transport/v2raywebsocket/conn.go:94 +0x71
github.com/sagernet/sing/common/bufio.(*BufferedWriter).Write(0xc0006626c0, {0xc000a9c000, 0x52, 0x80})
    github.com/sagernet/sing@v0.3.6/common/bufio/buffer.go:27 +0xd7
github.com/sagernet/sing/common/bufio.(*ExtendedWriterWrapper).WriteBuffer(0x7fbb3a364900?, 0xc0001d5dc0?)
    github.com/sagernet/sing@v0.3.6/common/bufio/conn.go:117 +0x8d
github.com/sagernet/sing-vmess.(*StreamChunkWriter).WriteBuffer(0xc0002eb400, 0xc00037ec80)
    github.com/sagernet/sing-vmess@v0.1.8/chunk_length_stream.go:161 +0x187
github.com/sagernet/sing-vmess.(*AEADWriter).WriteBuffer(0xc0002eb440, 0xc00037ec80)
    github.com/sagernet/sing-vmess@v0.1.8/chunk_aead.go:120 +0x10e
github.com/sagernet/sing/common/bufio.WriteBuffer({0x7fbafb293190?, 0xc0002eb440}, 0xc00037eb40)
    github.com/sagernet/sing@v0.3.6/common/bufio/io.go:47 +0x1b2
github.com/sagernet/sing-vmess.(*AEADWriter).Write(0xc000389400?, {0xc000d95180, 0x40, 0x40})
    github.com/sagernet/sing-vmess@v0.1.8/chunk_aead.go:99 +0x7c
github.com/sagernet/sing/common/bufio.(*ChunkWriter).Write(0xc000012df8, {0xc000d95180?, 0xc0007fa700?, 0xc000389680?})
    github.com/sagernet/sing@v0.3.6/common/bufio/chunk.go:111 +0xca
github.com/sagernet/sing-vmess.(*clientConn).Write(0x0?, {0xc000d95180?, 0xc0007fa910?, 0xc000d69a38?})
    github.com/sagernet/sing-vmess@v0.1.8/client.go:447 +0x2c
crypto/tls.(*Conn).flush(0xc0007fa700)
    crypto/tls/conn.go:954 +0x42
crypto/tls.(*clientHandshakeStateTLS13).handshake(0xc00095dc08)
    crypto/tls/handshake_client_tls13.go:108 +0x294
crypto/tls.(*Conn).clientHandshake(0xc0007fa700, {0x7fbafb29c670?, 0xc000491040})
    crypto/tls/handshake_client.go:263 +0x59a
crypto/tls.(*Conn).handshakeContext(0xc0007fa700, {0x7fbafb29c638, 0xc00039a060})
    crypto/tls/conn.go:1552 +0x3d3
crypto/tls.(*Conn).HandshakeContext(...)
    crypto/tls/conn.go:1492
net/http.(*persistConn).addTLS.func2()
    net/http/transport.go:1555 +0x6d
created by net/http.(*persistConn).addTLS in goroutine 1664
    net/http/transport.go:1551 +0x31b

Are you willing to submit a PR? If you know how to fix the bug.

trashux12 commented 3 months ago

i have same problem please help

aminmr commented 3 months ago

any update on this issue? @hiddify-com

titancomputer commented 1 month ago

duplicate issue https://github.com/hiddify/hiddify-next/issues/1173