Skip to content

Fix removing module from appdomain in DB_IPCE_UNLOAD_MODULE event#123931

Merged
hoyosjs merged 1 commit intodotnet:mainfrom
tommcdon:dev/tommcdon/fix_debugger_module_unload
Feb 10, 2026
Merged

Fix removing module from appdomain in DB_IPCE_UNLOAD_MODULE event#123931
hoyosjs merged 1 commit intodotnet:mainfrom
tommcdon:dev/tommcdon/fix_debugger_module_unload

Conversation

@tommcdon
Copy link
Member

@tommcdon tommcdon commented Feb 3, 2026

The debugger keeps track of loaded modules in a hashtable. When a module is unloaded, it should be removed from the hash, otherwise it will incorrectly cache the module on subsequent re-loads.

Fixes #123930

@tommcdon tommcdon added this to the 11.0.0 milestone Feb 3, 2026
@tommcdon tommcdon self-assigned this Feb 3, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 10, 2026

/ba-g failure is #123912

1 similar comment
@hoyosjs
Copy link
Member

hoyosjs commented Feb 10, 2026

/ba-g failure is #123912

@hoyosjs hoyosjs merged commit d78c24c into dotnet:main Feb 10, 2026
100 of 104 checks passed
@hoyosjs
Copy link
Member

hoyosjs commented Feb 10, 2026

/backport to release/10.0

@github-actions
Copy link
Contributor

Started backporting to release/10.0 (link to workflow run)

steveisok pushed a commit that referenced this pull request Feb 11, 2026
…ODULE event (#124241)

Backport of #123931 to release/10.0

/cc @hoyosjs @tommcdon

## Customer Impact

- [X] Customer reported
- [ ] Found internally

When loading and unloading an Assembly multiple times in new
AssemblyLoadContexts Visual Studio will abruptly end debugging before
program completion with the following error:

> A fatal error has occurred and debugging needs to be terminated. For
more details, please see the Microsoft Help and Support web site.
HRESULT=0x80131c36. ErrorCode=0x0.

Originally reported via Visual Studio feedback item [Fatal error
encountered when debugging .net 10 app using collectible assemblies in
VS2026](https://developercommunity.visualstudio.com/t/Fatal-error-encountered-when-debugging-/10982926),
then moved to GH issue #123930.

## Regression

- [X] Yes
- [ ] No

Regression from .NET 9, introduced in .NET 10 on #117224 and was a
missed case when attempting to address the issue in #118414.

## Testing

Validated with customer's reproducible test case on #123930

## Risk

Low. The debugger module caches uses the module as the hash key rather
than the assembly. This was a missed case when fixing #118414 where we
were still incorrectly using the assembly as the lookup key.

Co-authored-by: Tom McDonald <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fatal error encountered when debugging .NET 10 app using collectible assemblies

4 participants