Skip to content

release blocker: stable packed loop reads stale forwarded array after cross-call growth #9117

Description

@proggeramlug

Release blocker

The full release CI run for v0.5.1519 fails deterministically in:

  • cargo-test-perry (8/8)
  • issue_5139_object_arraylike_method_dispatch::any_typed_real_arrays_keep_array_mutator_semantics

Observed output:

grow: 1000 1000 165171

Expected sum: 499500. Sampled array values (0, 1, 2, 99, 500, 999) are correct, so storage is intact and the optimized reduction is wrong.

Reproduction

RUST_TEST_THREADS=1 cargo test -p perry \
  --test issue_5139_object_arraylike_method_dispatch \
  any_typed_real_arrays_keep_array_mutator_semantics -- --exact --nocapture

Reproduced independently on perrymaster.skelpo.net at release SHA 259cf8b68dc1303cc4119595f96d458a52af8c4e.

Bisect

Automated exact compiler/runtime bisect:

The array is grown across a call boundary and the caller retains a forwarding stub. js_packed_arraylike_loop_guard follows that stub and validates the live target, but the ordinary-local stable-packed path discards the live address and reloads/de-tags the stale local for direct fast-clone reads. #9060 makes that clone reachable for the reduction by classifying js_shadow_slot_set as call-safe.

Required fix

Use js_packed_arraylike_loop_guard_live for ordinary-local admission as well as captured receivers, and feed its returned live receiver address to the fast clone. Retain the generic slow clone on a zero result. Update IR assertions to expect the stronger live guard.

Before merging/releasing, verify:

  • the exact issue_5139 test above;
  • all three issue_8690 versioned-loop tests, including three live-guard calls in the read-only IR fixture;
  • issue_8655 and issue_8773 packed-loop IR/runtime coverage;
  • quick pre-tag checks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions