Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133572: Disable error reporting for invalid memory access on unsupported WinAPI partitions#133573

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
zooba merged 5 commits intopython:mainfrommaxbachmann:patch-5
May 15, 2025

Conversation

maxbachmann
Copy link
Contributor

@maxbachmannmaxbachmann commentedMay 7, 2025
edited by bedevere-appbot
Loading

aside from the mimalloc fix that has to be downstreamed later on this is the last change required to get cpython to compile on the xbox again

@maxbachmannmaxbachmann changed the titlegh-133572: disable invalid memory error reporting on unsupported WinAPI partitionsgh-133572: Disable error reporting for invalid memory access on unsupported WinAPI partitionsMay 7, 2025
@zooba
Copy link
Member

An alternative would be something like DONT_USE_LSA to make clear we just don't support the lsa handling, but do support structured exceptions.

Oh, it's only the error number conversion that's a problem? Let's just shim that bit out then and keep the SEH. Perhaps add this just before the macro and then call it?

staticvoid_PyErr_SetFromNTSTATUS(NTSTATUSstatus) {#if (macrohere)PyErr_SetFromWindowsErr(LsaNtStatusToWinError(status));#elseif (status&0x80000000) {// HRESULT-shaped codes are supported by PyErr_SetFromWindowsErrPyErr_SetFromWindowsErr((int)status);    }else {// No mapping for NTSTATUS values, so just return it for diagnostic purposes// If we provide it as winerror it could incorrectly change the type of the exception.PyErr_Format(PyExc_OSError,"Operating system error NTSTATUS=0x%08lX",status&0xFFFFFFFF);    }#endif}

Or that function might even have a home with the other error setters, but I don't know that we've needed it anywhere else. If you want to put it in (IIRC) errors.c, don't make it static, but also don't use PyAPI_FUNC on it - no need for it to be exported from the DLL.

@zooba
Copy link
Member

And sorry about multiple changes - my fault for giving direction without having fully understood the problem!

@maxbachmann
Copy link
ContributorAuthor

BothNTSTATUS andLsaNtStatusToWinError aren't defined in these partitions. I added your function and only do the conversion toNTSTATUS when performing the lsa to win error conversion

@zoobazooba merged commit4341095 intopython:mainMay 15, 2025
39 checks passed
@zooba
Copy link
Member

Perfect, thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zoobazoobazooba left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@maxbachmann@zooba

[8]ページ先頭

©2009-2025 Movatter.jp