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

未关闭
#5,947 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
cpp

调研方向

检查 Microsoft.Diagnostics.DebugServices.UnitTests.csproj 和 ConfigFiles/Windows/Debugger.Tests.Config.txt,然后结合 issue #3111 检查 ClrmaTests 和 BangAnalyzeTests。评估启用支持 ext.dll 的调试器,或使用 native harness 在没有 command scope 的情况下调用 CLRMACreateInstance 和 AssociateClient。完成标准是 CI 执行真实的 out-of-command-scope 路径,并阻止 g_Ext*-null 崩溃。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
C++
星标
1.3k
派生
407
平均合并
21 小时 5 分钟
30 天内合并 PR
78

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dotnet/diagnostics 的其他 Issue

查看 dotnet/diagnostics 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。