-
-
Notifications
You must be signed in to change notification settings - Fork 34k
bpo-40915: Fix mmap resize bugs on Windows (GH-29213) #29213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d8656e6
On Windows, if a named mmap section is held by more than one handle, …
tjguk f9750eb
A pagefile-backed mmap can now be resized (under the cover it's being…
tjguk 4c9b0fe
Merge branch 'main' into issue40915-mmap-resize
tjguk b114bc1
Make sure that resizing includes the offset when calculating the new …
tjguk 2742cad
Add & tweak resize tests for Windows:
tjguk 00f3be6
Add useful commentary to the new resize logic
tjguk ea48010
Add some tentative docs to reflect the new changes
tjguk b1a6c5f
Add a specific test to check that resizing a named mapping fails with…
tjguk 866a376
Use the existing `error` value as `GetLastError` might return a diffe…
tjguk eef2b79
Be specific about the exception type raised
tjguk af636d6
Pick up an error when resizing the file even if everything else succeeds
tjguk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to have missed this before you merged. Naming kernel objects with generic names like "foo" and "TEST" is a bad idea because the namespace is shared by every process in the current session. It's a serious problem in all of the tests that use
tagname. If the name is an existing Section object (i.e. file mapping),CreateFileMapping()will succeed with the last error set toERROR_ALREADY_EXISTS. In many cases, the Section object likely refers to an unrelated file, but we can't avoid this, or even know about the problem, becausemmapdoesn't currently support exclusive ("x") creation. This and a few other cases really need to be addressed in the constructor, but that's a separate issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eryksun -- good catch. Funnily enough, I'm normally a little over-obsessive with test names, generating them randomly to descrease any chance of a "lucky name". This time I've gone the other way! I'll run up a quick patch to fix this.