[cDAC] Always assign IStringHolder in DacDbi GetModulePath for pathless modules - #131518
Open
tommcdon wants to merge 1 commit into
Open
[cDAC] Always assign IStringHolder in DacDbi GetModulePath for pathless modules#131518tommcdon wants to merge 1 commit into
tommcdon wants to merge 1 commit into
Conversation
…ss modules cDAC's DacDbiImpl.GetModulePath returned S_OK with pResult=FALSE but left the IStringHolder unassigned when a module has no on-disk path (dynamic / in-memory modules, e.g. LCG DynamicMethod / DLR). The native DBI (CordbModule::GetModulePath) asserts m_strModulePath.IsSet(), so an unassigned holder makes ICorDebugModule::GetName fail with E_FAIL, which the debugger surfaces as "bad OnModuleLoad" on the module-load callback. The legacy DAC (DacDbiInterfaceImpl::GetModulePath) always assigns the holder - to an empty string in the pathless case. Match that behavior so cDAC and legacy agree and dynamic-module scenarios work under DOTNET_ENABLE_CDAC. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea95a5dd-3256-4da0-8278-80b40e717cd5
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes cDAC’s DacDbiImpl.GetModulePath so that, when a module has no on-disk path, the method still assigns the provided IStringHolder (to an empty string) instead of leaving it uninitialized.
Changes:
- Ensure
pStrFilenameis always assigned (tostring.Empty) whenGetModulePathreturnspResult == FALSEdue to an empty module path.
Comment on lines
+325
to
+326
| // pStrFilename needs to be set for ICorDebugModule::GetName to succeed. | ||
| hr = StringHolderAssignCopy(pStrFilename, string.Empty); |
hoyosjs
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cDAC's DacDbiImpl.GetModulePath returned S_OK with pResult=FALSE but left the IStringHolder unassigned when a module has no on-disk path (dynamic / in-memory modules, e.g. LCG DynamicMethod / DLR). The native DBI (CordbModule::GetModulePath) asserts m_strModulePath.IsSet(), so an unassigned holder makes ICorDebugModule::GetName fail with E_FAIL, which the debugger surfaces as "bad OnModuleLoad" on the module-load callback.