Skip to content

Conversation

@mangod9
Copy link
Member

@mangod9 mangod9 commented Jun 18, 2025

There has been one case where this leads to an AV / deadlock.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a potential access violation/deadlock by preventing the release mapping if VirtualAlloc fails.

  • Adds a NULL check after calling VirtualAlloc to ensure that mapping is not released when allocation fails.
  • Prevents subsequent operations on an invalid pointer, avoiding a crash.

@janvorli
Copy link
Member

The PR title is a bit misleading - it should rather be "don't try to zero out mapping if VirtualAlloc fails". That's what was causing the problem.

@mangod9 mangod9 changed the title dont try to release mapping if VirtualAlloc fails dont try to zero-out mapping if VirtualAlloc fails Jun 18, 2025
@mangod9
Copy link
Member Author

mangod9 commented Jun 18, 2025

The PR title is a bit misleading - it should rather be "don't try to zero out mapping if VirtualAlloc fails". That's what was causing the problem.

sure, changed the title. Thx.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@mangod9 mangod9 merged commit f4bc468 into dotnet:main Jun 18, 2025
97 checks passed
@mangod9 mangod9 deleted the fix_reservepage_av branch June 18, 2025 21:09
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants