signal: describe what the OS handler actually writes, and cover duck-typed re group selectors - #1225
Conversation
`register_ticker`, `signal_pushback`, and the `ticker_addr` handoff in `install_signal_handling` all documented the OS handler as forcing the ticker negative. The handler sets the pending bit and arms the eval-breaker's async bit, both lock-free atomics; `sync_async_ticker` is what drives the ticker negative, under the GIL. Assisted-by: Claude
`group`, `__getitem__`, `start`, `end`, and `span` take a group selector as a number when its type supplies `__index__` and as a name otherwise. The snippet only passed literal integers and literal names, so the `__index__` arm of the selector conversion was uncovered. Assisted-by: Claude
|
Warning Review limit reached
Next review available in: 34 seconds You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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 |
🤖 Codex parity reviewStatic analysis of this diff vs the local RPython/PyPy sources (commit efcb5ef). Files in the reviewed diff1. Regressions to PyPy parity introduced by this patchNone. 2. Other mismatches introduced by this patchNone. 3. Pre-existing mismatches (already present before this patch)None. 4. Structural adaptations
|
Two independent follow-ups from the #1209 review.
signal: the ticker comments named the wrong writerThree comments —
register_ticker,signal_pushback, and theticker_addrhandoff ininstall_signal_handling— documented the OS signal handler as forcing theActionFlagticker negative. It does not. The handler sets the pending bit and arms the eval-breaker's async bit, both lock-free atomics;sync_async_tickerdrives the ticker negative later, under the GIL. That split is exactly what keeps the handler async-signal-safe, so the comments now say why the handler must not write that cell.Comments only; no behaviour change. A reviewer named one of the three sites — the other two carried the same claim.
re:__index__arm of the group-selector conversion was uncoveredgroup,__getitem__,start,end, andspantake a selector as a number when its type supplies__index__and as a name otherwise.stdlib_re.pyonly ever passed literal integers and literal names, so the conversion's__index__arm — which runs arbitrary Python — was never exercised.Not included
The review's Critical finding on
sre_match_group(an unrooted*const W_SRE_Matchheld acrossdo_span, which can run arbitrary Python) is refuted.W_SRE_Matchis built only byw_sre_match_new→W_SRE_Match::allocate_stable→alloc_in_oldgen; MiniMark's mark-sweep never moves old-gen objects, anddrag_out_rootrelocates onlyis_nursery_object_startrefs.allocate_stableexists precisely so callers can hold the raw pointer on the Rust stack without rooting it. I did write that "fix" before checking the allocator, then reverted it.