Skip to content

perf_jit_trampoline: mmap failure check uses wrong error value #144194

Closed

Description

@stratakis

Bug report

Bug description:

In Python/perf_jit_trampoline.c, the perf_map_jit_init function checks for NULL to detect mmap failures, but mmap() returns MAP_FAILED (which is (void*)-1) on error, not NULL.

if (perf_jit_map_state.mapped_buffer == NULL) {

This means mmap failures are never detected, and jitdump initialization proceeds with an invalid pointer.

CPython versions tested on:

CPython main branch, 3.15, 3.14, 3.13

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added a commit that references this issue on Jan 23, 2026
  2. added 3 commits that reference this issue on Jan 24, 2026
  3. added a commit that references this issue on Jan 28, 2026
  4. added a commit that references this issue on Jan 28, 2026
  5. added 2 commits that reference this issue on Jan 28, 2026
  6. added a commit that references this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-JITtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions