Report malformed remote protocol data instead of defaulting to zero
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- cpp
研究方向
Start by reading the dropped implementation in commit f7a1961 and the exception boundaries around ExecuteAdapterAndWait, NotifyStopped, HandleSpontaneousAdapterStop, WorkerThreadMain, and InvokeBackendCommand. Inspect esrevenadapter.cpp, PacketToUnorderedMap, and GdbMiAdapter::ReadMemory for the listed parsing problems. Done means malformed data is reported with its field and value, sessions tear down fully, stop-channel state is exception-safe, and unrecognized stop-reply fields are ignored.
由索引模型根據 Issue 內容生成。
描述
Follow-up to #1164 / #1166.
#1166 stops the crash by parsing remote stub data with a non-throwing helper that returns 0 on malformed input. That means a corrupt packet silently becomes a valid-looking answer — a bad thread id turns into thread 0, and we then show the user the wrong thread's registers with no indication anything is wrong. Accepted deliberately to keep the fix local during feature freeze.
The session should instead end deliberately, reporting the offending field and data. An attempt at that was dropped from #1166 (commit f7a1961); review of it showed what a real implementation needs:
- Wider catch boundary than
ExecuteAdapterAndWait.NotifyStoppedruns after it returns and refreshes caches;HandleSpontaneousAdapterStophas no boundary;WorkerThreadMainruns tasks bare, so an escape isstd::terminate;InvokeBackendCommandreaches monitor-command decoding directly from the API/FFI. - Real transport teardown. A synthetic
TargetExitedonly updates BN-side state. The teardown lives in the adapter (m_socket->Kill(),delete m_rspConnector,InvalidateCache). Alsom_adapteris never reset on any session end today, soCreateDebugAdapterreuses it. - RAII on the stop channel. An exception between setting and clearing
m_inAdapterWaitleaves a stale pending stop that swallows later adapter events. - Ignore unrecognized stop-reply fields.
PacketToUnorderedMapparses everykey:valueas hex, but the spec requires unknown pairs be ignored and defines non-hex values we advertise support for (replaylog:begin,exec:<hex pathname>,fork/vforkpPID.TID). Parsing only the keys we consume is both spec-correct and smaller.
Outstanding regardless of the exception work:
esrevenadapter.cppstill uses rawstd::stoull(:1797,:2249,:2251) andstd::stoi(:2309) — the call sites #1164 describes.PacketToUnorderedMap:T05thread:1:garbage;splits into three tokens and falls through topacket_map[key] = 0; values are truncated to 16 chars before validation, so trailing garbage disappears.GdbMiAdapter::ReadMemorychecksfrom_chars().ecbut not full consumption, so"aZ"parses as0x0a; odd-length replies truncate; hard errors return an all-zero buffer indistinguishable from valid memory.
- 主要語言
- C++
- 星號
- 338
- 分支
- 33
- 平均合併
- 4 天 52 分鐘
- 30 天內合併 PR
- 8
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Vector35/debugger 的其他 Issue
-
bug Effort: Trivial
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
bug Effort: Trivial Impact: Low
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 95/100
維護者通常 1 天內回覆
-
Effort: Trivial enhancement UI
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
Vector35/debugger#1148 · 1 則留言 ·
維護者通常 1 天內回覆
查看 Vector35/debugger 的全部 Issue
相似的 Issue
-
Issue-Bug Needs-Triage
難度 2/5 1-3 小時 新手友好度 62/100
microsoft/winget-cli#6645 ·
維護者通常 2 天內回覆
-
cleanup help wanted
難度 2/5 1-3 小時 新手友好度 62/100
ESPresense/ESPresense#2602 ·
維護者通常 1 天內回覆
-
devex good first issue
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 3 天內回覆