Skip to content

Handle unavailable module image metadata - #6082

Closed
max-charlamb wants to merge 1 commit into
dotnet:mainfrom
max-charlamb:fix-module-image-info
Closed

max-charlamb wants to merge 1 commit into
dotnet:mainfrom
max-charlamb:fix-module-image-info

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Adapt #5963 by @hoyosjs to distinguish unavailable module image metadata from a known unmanaged/non-PE image. This addresses recurring DebugServices module-comparison failures when dump headers are absent and the corresponding image cannot be acquired; it does not change symbol-download retry behavior.

  • Add optional IModuleImageInfo without changing IModule, preserve per-module LLDB probe behavior, and display <unknown> for unavailable managed/layout classifications.
  • Use separate offline dump hosts for ModuleTests, retaining adjacent fixture lookup. Skip only IsManaged and IsFileLayout comparisons when metadata is unavailable, log each exclusion, and require availability for adjacent fixture images.
  • Preserve symbol-server/cache access for other tests, including DAC acquisition in RuntimeTests.
  • Add 10 deterministic regression cases covering valid managed/native PE images, missing/truncated images, non-PE images, symbol-source isolation, and LLDB probing.

Validation

  • Targeted build: zero warnings/errors.
  • Windows x64: 53/53 actual cases passed; Windows x86: 29/29. Both include all 10 new regression cases.
  • Module tests with an unreachable HTTP/HTTPS proxy: x64 9/9, x86 3/3.
  • Test identities/outcomes match the previous local validation. Full-suite XML retains two pre-existing test-metadata errors; filtered module reports have none.
  • Native Linux/macOS execution has not been validated locally; keeping this draft while CI runs.

Adapt dotnet#5963, preserving per-module LLDB probe behavior and limiting offline symbol configuration to module tests. Add regression coverage for image availability and preserve runtime-test symbol access.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
@max-charlamb

Copy link
Copy Markdown
Member Author

Superseded by #6087, which fixes the underlying CI flakiness with a test-only approach instead of the product API change proposed here.

max-charlamb added a commit that referenced this pull request Oct 7, 2026
## Summary

ModuleTests intermittently fails in CI when the real symbol server is
unreachable or a download fails for one of the frozen .NET 6.0
test-asset dumps (DivZero/WebApp3), causing module metadata (e.g.
IsManaged) to be misclassified against the expected value. This is a
test-infrastructure-only fix: no product behavior changes.

## Changes

- **DebugServicesTests.cs**: adds a TraceListener-based
SymbolDownloadFailureListener that watches for HttpSymbolStore's
existing failure log messages during a test run. If a module metadata
comparison (CompareMembers) fails *and* a download failure was observed,
the failure is converted into Xunit.Sdk.SkipException so the test
reports **Skipped** instead of **Failed**.
- **Tracer.cs**: fixes a latent bug where Tracer.Instance cached its
NullTracer/Tracer choice the *first time* any static Tracer member was
touched in the process, instead of reading the current Enable value on
each access. Because HttpSymbolStore logs exclusively through this
ITracer abstraction, a stale cached NullTracer could silently swallow
all of its failure messages for the rest of the test process -- which is
what let symbol-download failures go undetected rather than being
skipped. Instance is now a computed property.

## Validation

- Simulated a genuinely unreachable symbol server (temporarily pointing
TestDump at http://127.0.0.1:1/ with a cold symbol cache) and confirmed
previously-hard-failing ModuleTests cases now report **Skipped**:
  - 	otal: 9, failed: 0, succeeded: 6, skipped: 3
- Reverted that temporary experiment and reran the full suite with
normal network access to confirm no regressions:
- otal: 45, failed: 2 (pre-existing, unrelated ClrmaTests failures),
succeeded: 43, skipped: 0

## Related

Supersedes #6082, which took a product-API approach (tri-state module
image classification). This PR instead fixes the flakiness purely on the
test side, with a minimal, low-risk product fix for the Tracer.Instance
bug discovered along the way.

---------

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant