Fix continuation names appearing wrong in SOS debugger#121010
Conversation
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
|
This is the exact same change as in #121009; the same tree 144741b2a29064de67474257541e86426e4b4db6 in both. https://github.com/dotnet/runtime/compare/copilot/fix-continuation-names-sos..copilot/fix-continuation-names-sos-again |
|
@KalleOlaviNiemitalo Thanks -- I closed #121009. |
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where continuation method table names displayed incorrectly with garbage data in the SOS debugger. The root cause was the use of raw C++ pointers instead of DAC-aware pointer types when reading GC descriptor information across process boundaries during debugging.
Key Changes:
- Updated
PrintContinuationNamefunction to use DAC-aware pointer types (PTR_CGCDescandPTR_CGCDescSeries) instead of raw pointers - This ensures proper memory access semantics when SOS reads data structures across process boundaries
Summary
Fixes continuation names appearing incorrectly in SOS debugger by using DAC-aware pointer types in
PrintContinuationName.Problem
When debugging with SOS, continuation method table names displayed incorrectly with garbage data:
However, the internal
debug_m_szClassNameshowed the correct name:Root Cause
The
PrintContinuationNametemplate function inasynccontinuations.hwas using raw C++ pointers (CGCDesc*andCGCDescSeries*) instead of DAC-aware pointer types (PTR_CGCDescandPTR_CGCDescSeries). This caused incorrect memory reads when the function was called from debugging contexts like SOS.Solution
Updated the three pointer declarations in
PrintContinuationNameto use DAC-aware types:CGCDesc* desc→PTR_CGCDesc descCGCDescSeries* lowestSeries→PTR_CGCDescSeries lowestSeriesCGCDescSeries* curSeries→PTR_CGCDescSeries curSeriesThe
PTR_wrappers provide proper memory access semantics when reading data structures across process boundaries in debugging scenarios, ensuring SOS can correctly read GC descriptor information and display the proper continuation names.Testing
Fixes #<issue_number>
Original prompt
Fixes #121008
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.