Report malformed remote protocol data instead of defaulting to zero
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- cpp
- Lĩnh vực
- devtools, reverse-engineering
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 334
- Fork
- 33
- Merge trung bình
- 5 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Vector35/debugger
-
LLDB Adapter leaks breakpointsĐang mởbug Effort: Trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug Effort: Trivial Impact: Low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 3 ngày
-
fix wine documentation linkĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Effort: Trivial enhancement UI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Vector35/debugger#1148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Vector35/debugger
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ws_bridge: stripping format=evr for matchmaker connections can concatenate the path and queryĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
EchoTools/nevr-runtime#116 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
code-quality libc++
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
llvm/llvm-project#229284 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test-issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
llvm/offload-test-suite#1557 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày