-
-
Notifications
You must be signed in to change notification settings - Fork 34k
gh-144194: Fix mmap failure check in perf_jit_trampoline.c #143713
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi, I think a related issue and a news entry file are needed for this PR. Please read the Dev Guide (especially https://devguide.python.org/getting-started/pull-request-lifecycle/) to see what is required when creating a PR. |
vstinner
left a comment
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.
The change LGTM, but I agree with @aisk: it would be nice to document the fix in a NEWS entry.
| Fix mmap failure check in perf jitdump initialization. The code incorrectly | ||
| checked for NULL instead of MAP_FAILED, causing failures to go undetected. |
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.
Can the news entry focus on what was fixed, not how (that's what we have diffs for). They are for end-users, not people familiar with internals.
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.
What would you suggest? This is a fix for the internals after all that I noticed myself in the code, while working on another issue. And fixes for such types of issues have been many times in NEWS entries before, other times the NEWS entry is skipped, which is what I was going for in this case.
|
You need to update your branch to fix the CI, it is incompatible. |
mmap() returns MAP_FAILED ((void*)-1) on error, not NULL. The current check never detects mmap failures, so jitdump initialization proceeds even when the memory mapping fails.
mmap() returns MAP_FAILED ((void*)-1) on error, not NULL. The current check never detects mmap failures, so jitdump initialization proceeds even when the memory mapping fails.