Repository navigation
Translate WASI signal dispositions through libc sentinels - #9024
Conversation
Keep Python disposition values distinct from WASI function-table pointers. Recognize wasi-libc SIG_ERR before updating Python handlers and preserve ignored/default/custom dispositions. Add synchronous signal and rejected-registration regressions to the existing snippet. AI assistance covered source investigation, implementation, and automated reference/baseline tests. Isolated patched runtime validation is pending. No human validation is claimed. Assisted-by: Codex:model-version-unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59f9e3ccd7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| previous = signal.signal(signal.SIGILL, synchronous_handler) | ||
| try: | ||
| signal.raise_signal(signal.SIGILL) |
There was a problem hiding this comment.
Remove the added signal test block
This starts a new signal exercise and the following assertions in an existing test file, but the repository's test-code policy permits only adding an expected-failure decorator or removing one and its TODO once the test passes, and explicitly forbids modifying test logic or assertions. Remove this added snippet coverage rather than editing this test file.
AGENTS.md reference: AGENTS.md:L275-L279
Useful? React with 👍 / 👎.
Scope
Translate Python's
SIG_DFLandSIG_IGNvalues through the actual libc signal dispositions on WASI, and recognize libc'sSIG_ERRbefore updating Python's handler table.WASI uses function-table pointers for its signal sentinels. Treating them as the usual integer values lets an ignored synchronous signal trap and lets an uncatchable signal registration appear to succeed. A typed host boundary keeps Python's numeric values distinct from libc's default, ignored, and custom handlers.
This is a narrow Python 3.14 compatibility extraction from #8954. It does not include the separate wakeup-fd error-reporting changes.
Regression coverage
The existing signal snippet adds synchronous custom delivery, replacement with
SIG_IGN, ignored delivery, and restoration. On WASI it also checks that SIGKILL/SIGSTOP registration raisesOSErrorwithout changing the Python handler table. Existing canonical tests and assertions are unchanged.Verification
Actual RustPython modules were built from current main bd8fdb7 and the isolated commit 59f9e3c, using the same source station, official
wasm32-wasip1target, and build flags:Under Wasmtime 49.0.0:
RaiseSignalTest.test_sigintandtest_handlerpass on both versions.extra_tests/snippets/stdlib_signal.pyby the fixed RustPython WASM module.The updated snippet also passes the repository pytest runner on CPython 3.14.7 and the Linux RustPython baseline. Normal commit hooks pass. Native Linux Clippy with warnings denied, the workspace compile-only aggregate, and the separate C-API compile-only aggregate all pass on the exact isolated source tree. Broad runtime suites were deliberately not run during this extraction.
Reference implementations: CPython 3.14 signalmodule.c, wasi-libc signal constants, and wasi-libc signal implementation.
AI assistance: OpenAI Codex assisted with source comparison, implementation, regression design, and automated verification under the user's direction. No manual validation is claimed.