fix(gc-check): recognise js_url_coerce_string as a heap-value source - #7454
Conversation
ALLOC_RE covers fresh-string producers by naming convention. There are exactly three `coerce -> *mut StringHeader` helpers in the runtime; `js_string_coerce` and `js_jsvalue_to_string_coerce` are matched by existing patterns, but `js_url_coerce_string` reads `url_coerce_string` after the `js_` prefix and matched none of them. That gap is why the checker did not flag #7453. On the pre-fix IR the widened matcher reports it, and reports it as MOVING: source (alloc): %r23 = call i64 @js_url_coerce_string(double %r22) stale use : %r26 = call i64 @js_url_new_with_base(i64 %r23, %r25) between : js_url_coerce_string, perry_fn_url_root_ts__mk MOVING : YES via perry_fn_url_root_ts__mk Measured, per the extrapolated-suffix warning in the same list: the symbol was verified to exist before the pattern was added, stale-register uses on that IR go 3 -> 4 (the new one is the bug), and both gated arms over the 144-module corpus stay at 0 violations with 40/40 seeded violations caught.
|
Warning Review limit reached
Next review available in: 3 minutes 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
Closes the detector gap that let #7453 through.
ALLOC_REclassifies fresh-heap-value producers by naming convention. The runtime has exactly threecoerce -> *mut StringHeaderhelpers:js_string_coercestring_coercejs_jsvalue_to_string_coercejsvalue_to_string\w*js_url_coerce_stringurl_coerce_stringafter thejs_prefixSo a raw
StringHeaderpointer returned by the URL coercion was invisible to the checker, which is why #7453 had to be found by reading code rather than by the gate.Measured, not extrapolated
The list carries an explicit warning about patterns added by extrapolating a suffix and then matching nothing. So:
crates/perry-runtime/src/url/mod.rs:116.js_url_coerce_string→ matches;js_string_coerce→ still matches;js_url_get_href→ does not.MOVING: YES. That is worth recording: I described #7453 as latent in its PR, and the checker's own classification is stronger than that — the stale use is reachable from a moving minor via a user call.--seeded-violationsstill reports 40 planted / 40 caught / 0 MISSED, and--self-testpasses. The widening is additive: no previously reported source changes kind.Stacked on #7452 (which restored the corpus) and #7453 (the bug itself).