Add CI coverage for the exported CLRMA `!analyze` path (dbgeng, out of command scope)

Đang mở
#5,947 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cpp
Lĩnh vực
devtools, testing-qa

Hướng nghiên cứu

Xem xét Microsoft.Diagnostics.DebugServices.UnitTests.csproj và ConfigFiles/Windows/Debugger.Tests.Config.txt, sau đó kiểm tra ClrmaTests và BangAnalyzeTests cùng với issue #3111. Đánh giá việc bật một debugger có khả năng sử dụng ext.dll hoặc sử dụng một native harness để gọi CLRMACreateInstance và AssociateClient mà không có command scope. Được xem là hoàn tất khi CI thực thi đường dẫn out-of-command-scope thực tế và ngăn crash g_Ext*-null.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Background

PR #5946 fixed a crash on the native (non-hosted) CLRMA path where the exported CLRMACreateInstance (invoked by dbgeng !analyze via ext!CLRMACreateCached) borrowed command-scoped g_Ext* debugger globals that are null outside a !command. Regression originated in #4667.

That PR added coverage that exercises the fixed native Target/DataTarget/Runtime object graph via !clrma under cdb with !SetHostRuntime -none. However, this does not reproduce the original crash, because the !clrma command runs in command scope (INIT_API_EXT() -> ExtQuery populates g_Ext* for the command's duration). The only trigger that runs outside command scope is dbgeng's !analyze, which we cannot exercise in CI today.

Why !analyze can't be tested in CI currently

  • No ext.dll in the test debugger package. The cdb-sos package (10.0.26100.1) used by the tests ships only dbgcore/dbgeng/dbghelp/DbgModel/symsrv - no ext.dll, so !analyze fails with "No export analyze found". DbgEngPath in Microsoft.Diagnostics.DebugServices.UnitTests.csproj points at this same package.
  • TestDbgEng harness is disabled. The <TestDbgEng>true</TestDbgEng> config blocks in ConfigFiles/Windows/Debugger.Tests.Config.txt are commented out (tracked by #3111), so ClrmaTests/BangAnalyzeTests (the only harness that issues !analyze) don't run in CI.

Ask

Add a test that drives CLRMA through the real out-of-command-scope entry point so the exact g_Ext*-null crash path is gated in CI. Options to evaluate:

  • Provide an ext.dll-capable debugger in the test assets (or a minimal harness) and re-enable a scoped TestDbgEng configuration (see #3111) so !analyze -v can run against a managed crash dump.
  • Alternatively, add a small native test harness that calls the exported CLRMACreateInstance + AssociateClient directly with no active command (mirroring ext!CLRMACreateCached), asserting no fault when the command-scoped globals are null.

References

  • Fix: #5946
  • Regression origin: #4667
  • Related disabled harness: #3111
Ngôn ngữ chính
C++
Star
1.3k
Fork
407
Merge trung bình
21 giờ 5 phút
Pull request đã merge (30 ngày)
78

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/diagnostics

Tất cả issue của dotnet/diagnostics

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.