Repository navigation
Avoid epoll alias ownership aborts - #9250
youknowdot wants to merge 1 commit into
Conversation
Keep Python-visible epoll descriptors in a raw host wrapper, preserving fromfd aliasing and explicit close errors without OwnedFd drop aborts. Use native epoll event layout behind a transparent host-only type and align positive timeout overflow with CPython milliseconds. Assisted-by: OpenAI Codex:model-version-unavailable
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Fix the debug-profile abort exposed by the coverage run after #9234.
select.epoll.fromfd()deliberately aliases its caller's descriptor, but RustPython represented both aliases asOwnedFd. Closing one and later dropping the other violated Rust's exclusive-ownership contract and aborted the process.epoll_ctlandepoll_waitthroughhost_env, using a transparent host-only wrapper over libc's native event layout, including Redox padding. No artificialBorrowedFdlifetime is asserted for descriptors supplied by Python.The patch changes only
crates/host_env/src/select.rsandcrates/stdlib/src/select.rs. No Lib changes, test skips, assertion edits or CI workflow changes.Reference and scope
Source commit
75346b7f12is based on mainb4a1ad232f8eb68523ce687183ce08958d4b6744. Its Rust/Cargo source bytes match the locally tested pre-commit tree. Main subsequently advanced toebb6a78521with disjoint reflected-multiplication changes; local results are not attributed to that newer merge. The original ownership patch rebased without conflicts; the final follow-up keeps the native event type behind a transparent host-only wrapper to satisfy the existing stdlib lint boundary. Compare pinned CPython 3.15.0 selectmodule.c.Existing unrelated differences remain:
fromfd(-1)raises EBADF in RustPython while CPython's shared constructor creates an epoll;poll(maxevents=0)reaches the syscall and reports EINVAL in RustPython while CPython raises ValueError. These are not hidden by the focused probe.Validation
-D warnings. Normal configured file hooks passed (merge conflict, rustfmt and cspell; non-applicable hooks skipped normally).These are focused runtime results, not a full
test_epollpass. The canonical module's shared setup opens sockets, so it was not run locally under the current execution boundary. Full current-source workspace/CAPI tests, all-target lint, instrumented coverage, signal-interruption runtime, and non-Linux runtime validation remain unrun. Earlier ImportError native-suite results belong to different source and are not reused as this patch's validation.Local full native gates required by the repository guidance remain outstanding; this draft does not present focused checks as their substitute.
AI assistance
Assisted implementation, source review and automated validation by OpenAI Codex. This reports automated checks, not additional human testing. The commit includes an Assisted-by trailer; the exact model version is unavailable.
Summary by CodeRabbit