Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix mmap failure check in perf jitdump initialization. The code incorrectly
checked for NULL instead of MAP_FAILED, causing failures to go undetected.
Comment on lines +1 to +2
Copy link
Member

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.

Copy link
Contributor Author

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.

3 changes: 2 additions & 1 deletion Python/perf_jit_trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@ static void* perf_map_jit_init(void) {
0 // Offset 0 (first page)
);

if (perf_jit_map_state.mapped_buffer == NULL) {
if (perf_jit_map_state.mapped_buffer == MAP_FAILED) {
perf_jit_map_state.mapped_buffer = NULL;
close(fd);
return NULL; // Memory mapping failed
}
Expand Down
Loading