Skip to content

Fix ResourceUpdater.Dispose() - #120029

Merged
jtschuster merged 5 commits into
dotnet:mainfrom
jtschuster:ResourceUpdaterDispose
Sep 25, 2025
Merged

jtschuster merged 5 commits into
dotnet:mainfrom
jtschuster:ResourceUpdaterDispose

Conversation

@jtschuster

Copy link
Copy Markdown
Member

The apphost ResourceUpdater doesn't dispose of the PEReader when leaveOpen is true, but the leaveOpen should only apply to the FileStream passed to the constructor. The PEReader is not accessible from the creator and cannot be disposed of elsewhere. This causes some race conditions, especially in cases where the PEReader ends up mapping the file into memory.

Fixes dotnet/sdk#50784

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 23, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sbomer sbomer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise, thank you!

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

@jtschuster jtschuster removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 24, 2025
@jtschuster
jtschuster requested a review from agocke September 24, 2025 20:21
@jtschuster
jtschuster enabled auto-merge (squash) September 25, 2025 21:14
@jtschuster jtschuster added this to the 10.0.0 milestone Sep 25, 2025
@jtschuster
jtschuster merged commit 02509e4 into dotnet:main Sep 25, 2025
75 of 77 checks passed
agocke added a commit to agocke/runtime that referenced this pull request Sep 26, 2025
After dotnet#120029, some of the code was unreachable. This
change removes that code and standardizes the field style to the .NET Code Style guidelines.
@jtschuster

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18027400694

agocke added a commit that referenced this pull request Sep 26, 2025
After #120029, some of the code was unreachable. This
change removes that code and standardizes the field style to the .NET Code Style guidelines.
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GenerateBundle Task fails writing to singlefilehost.exe

5 participants