Repository navigation
Match mmap constructor audit ordering and argument conversion - #9489
Conversation
Emit platform-specific mmap.__new__ audit events with requested lengths and correct access semantics, use getargs-compatible access conversion and trackfd truth testing, and restore the canonical mmap audit test through update_lib. Assisted-by: OpenAI Codex: model version unavailable
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] test: cpython/Lib/test/test_sys.py (TODO: 4) dependencies: dependent tests: (249 tests)
Legend:
|
Merging this PR will not alter performance
Comparing Footnotes
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
mmap.__new__at CPython's platform-specific point: after argument validation/access normalization on Unix, before access/length/tag validation on Windows. Preserve requested length and propagate hook refusal before host mapping operations.accessusinggetargs.c's signed-int contract (C-long conversion followed by C-int bounds), without prematurely validating its enum. Use truth testing fortrackfd.test_audit.AuditTest.test_mmapusingscripts/update_lib migrate, retaining unrelated test adaptations.Source comparison: pinned CPython
new_mmap_object, Unix and Windows implementations,getargs.csigned-int conversion, andPyLong_AsLong.No storage/locking/GC changes, global argument-converter refactor, or flush changes. The existing conditional flush-test skip remains untouched. The existing Windows Rust fixture only receives the matching constructor field types.
Validation
AI assistance
OpenAI Codex assisted with implementation, CPython source comparison, and validation. The model version was unavailable.
Summary by CodeRabbit
ValueErrorfor access modes outside the supported range.trackfdargument is now interpreted as a boolean on both Unix and Windows.