v1.6.0
What's Changed
This release fixes the intermittent crashes (SIGSEGV) under heavy real-world traffic, and eliminates a long-hidden file-descriptor leak that degraded stability over time.
Fixed
- Crash root cause (UAF): replaced heap-allocated connection structs with an immortal slot table; epoll events now carry
(generation << 32 | slot)stamps so stale/ghost events are always detected instead of hitting reused memory. - FD leak:
ParcelFileDescriptor.fromSocket()duplicates the descriptor — target sockets were only closed on one side, leaking one CLOSE_WAIT socket per proxied connection (fd count previously climbed toward 16384). Both references are now closed. - Racing connect: a "late winner" socket from abandoned Happy-Eyeballs attempts could leak; now reclaimed and closed.
- Self-healing: stale epoll registrations are automatically purged (inode reverse-lookup), preventing event hot-loops even if a leak path ever reappears.
- DebugActivity: proxy port now persists across restarts; fixed layout height inside ScrollView.
Verification
- Stress suite T1–T4: 98% success at 16 concurrent threads × 30 s
- Soak test: 5 mixed burst/idle rounds — zero crashes, fd count stable
- Epoll registrations per worker dropped from ~266 to ~3–5; CLOSE_WAIT from 1000+ to transient 0–4
Full Changelog: v1.5.1...v1.6.0
更新內容(中文)
修復真實流量下數分鐘內崩潰(SIGSEGV)的問題,並根除長期隱藏的 fd 洩漏:
- 崩潰根因(UAF):連線結構改用永不釋放的槽位表,epoll 事件帶世代戳記,殘留事件一律安全攔截
- fd 洩漏:
fromSocket()會複製描述符,target socket 過去只關一邊,每條連線洩漏一個 CLOSE_WAIT;現已雙邊關閉 - 競速連線遲到勝者回收、幽靈註冊自動清除
- DebugActivity 埠號記憶 + 版面修正