shadowsocks / shadowsocks/shadowsocks-rust

在使用tun模式做透明代理流量很大的情况下,会触发panicked

Open
#2,164 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
10.9k
Forks
1.5k
Avg merge
4d 15h
Merged PRs (30d)
5

Description

非常感谢作者带来了tun模式,tun模式对于我一台老旧路由器的精简openwrt内核有着非常重要的作用,因为该路由器官方固件没有tproxy,甚至ipset也并未编译进系统,导致udp协议无法使用。
但是tun模式的出现拯救了我这台老旧路由器,代理效率(即速度)超出原本的期待。

回归到问题,该故障现象出现的时候有如下报错:
thread 'smoltcp-poll' (17908) panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/smoltcp-0.12.0/src/wire/tcp.rs:81:13:
attempt to subtract sequence numbers with underflow
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

如标题所述,该故障现象仅当在流量大的情况下出现,应该是TCP流量,UDP流量暂时没法测。
它不是随机偶尔出现,是一定会伴随着在大流量的情况出现的。

shadowsocks-rust版本是:
INFO shadowsocks local 1.24.0 build 2025-12-11T00:30:22.902795962+00:00

官方固件的openwrt版本是这个:
root@WRT32X:~# uname -a
Linux WRT32X 4.4.14 #4 SMP Wed Apr 4 18:23:44 UTC 2018 armv7l GNU/Linux

希望该issue能得到调查和修正。非常感谢!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce tun-mode operation under sustained high-volume TCP traffic on the reported shadowsocks-rust 1.24.0 and OpenWrt environment. Start at the smoltcp 0.12.0 panic reported in src/wire/tcp.rs:81 and use RUST_BACKTRACE=1 to trace the relevant path; done means the traffic no longer triggers sequence-number underflow or a panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.